當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。