当前位置: 首页>>代码示例>>Java>>正文


Java DumperOptions.setAllowUnicode方法代码示例

本文整理汇总了Java中org.yaml.snakeyaml.DumperOptions.setAllowUnicode方法的典型用法代码示例。如果您正苦于以下问题:Java DumperOptions.setAllowUnicode方法的具体用法?Java DumperOptions.setAllowUnicode怎么用?Java DumperOptions.setAllowUnicode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.yaml.snakeyaml.DumperOptions的用法示例。


在下文中一共展示了DumperOptions.setAllowUnicode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dumpMap

import org.yaml.snakeyaml.DumperOptions; //导入方法依赖的package包/类
protected final String dumpMap(LinkedHashMap<Object, Object> toStore, String header) {
	DumperOptions dumperOptions = new DumperOptions();
	toStore = cleanMap(toStore);
	dumperOptions.setDefaultFlowStyle(FlowStyle.BLOCK);
	dumperOptions.setAllowUnicode(true);
	Yaml rl = new Yaml(dumperOptions);
	StringWriter stringWriter = new StringWriter();
	BufferedWriter ws = new BufferedWriter(stringWriter);
	try {
		ws.write(header);
		ws.newLine();
		rl.dump(toStore, ws);
		return stringWriter.toString().replaceAll(NOVALUE, "");
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:OnPositive,项目名称:aml,代码行数:18,代码来源:GenericWriter.java

示例2: setupDumper

import org.yaml.snakeyaml.DumperOptions; //导入方法依赖的package包/类
private static void setupDumper() {
	options = new DumperOptions();
	representer = new Representer();

	options.setIndent(2);
	options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
	options.setAllowUnicode(Charset.defaultCharset().name().contains("UTF"));
	representer.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
}
 
开发者ID:hhaslam11,项目名称:Text-Fighter,代码行数:10,代码来源:Saves.java

示例3: dumpMap

import org.yaml.snakeyaml.DumperOptions; //导入方法依赖的package包/类
protected String dumpMap(LinkedHashMap<Object, Object> toStore) {
	DumperOptions dumperOptions = new DumperOptions();
	toStore = cleanMap(toStore);
	dumperOptions.setDefaultFlowStyle(FlowStyle.BLOCK);
	dumperOptions.setAllowUnicode(true);
	Yaml rl = new Yaml(dumperOptions);
	StringWriter stringWriter = new StringWriter();
	BufferedWriter ws = new BufferedWriter(stringWriter);
	try {
		rl.dump(toStore, ws);
		return stringWriter.toString().replaceAll(NOVALUE, "");
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:OnPositive,项目名称:aml,代码行数:16,代码来源:SwaggerWriter.java

示例4: getDumperOptions

import org.yaml.snakeyaml.DumperOptions; //导入方法依赖的package包/类
protected static DumperOptions getDumperOptions() {
    DumperOptions options = new DumperOptions();
    options.setAllowUnicode(true);
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    options.setIndent(4);

    return options;
}
 
开发者ID:ME1312,项目名称:SubServers-2,代码行数:9,代码来源:YAMLConfig.java

示例5: newYaml

import org.yaml.snakeyaml.DumperOptions; //导入方法依赖的package包/类
private static Yaml newYaml(boolean useSingleQuotes) {
    DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    options.setAllowUnicode(true);
    if (useSingleQuotes) {
        options.setDefaultScalarStyle(DumperOptions.ScalarStyle.SINGLE_QUOTED);
    }
    return new Yaml(options);
}
 
开发者ID:AuthMe,项目名称:ConfigMe,代码行数:10,代码来源:YamlFileResource.java

示例6: createYaml

import org.yaml.snakeyaml.DumperOptions; //导入方法依赖的package包/类
private Yaml createYaml() {
    DumperOptions options = new DumperOptions();
    options.setAllowUnicode(false);
    options.setDefaultScalarStyle(ScalarStyle.DOUBLE_QUOTED);
    return new Yaml(options);
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:7,代码来源:PrintableUnicodeTest.java

示例7: getYaml

import org.yaml.snakeyaml.DumperOptions; //导入方法依赖的package包/类
private static Yaml getYaml() {
    DumperOptions options = new DumperOptions();
    options.setAllowUnicode(true);
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    return new Yaml(options);
}
 
开发者ID:lucko,项目名称:LuckPerms,代码行数:7,代码来源:LegacyYamlMigration.java


注:本文中的org.yaml.snakeyaml.DumperOptions.setAllowUnicode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。