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


Java Representer.setDefaultFlowStyle方法代码示例

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


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

示例1: Yaml

import org.yaml.snakeyaml.representer.Representer; //导入方法依赖的package包/类
/**
 * Create Yaml instance. It is safe to create a few instances and use them
 * in different Threads.
 * 
 * @param constructor
 *            BaseConstructor to construct incoming documents
 * @param representer
 *            Representer to emit outgoing objects
 * @param dumperOptions
 *            DumperOptions to configure outgoing objects
 * @param resolver
 *            Resolver to detect implicit type
 */
public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions,
        Resolver resolver) {
    if (!constructor.isExplicitPropertyUtils()) {
        constructor.setPropertyUtils(representer.getPropertyUtils());
    } else if (!representer.isExplicitPropertyUtils()) {
        representer.setPropertyUtils(constructor.getPropertyUtils());
    }
    this.constructor = constructor;
    representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
    representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
    representer.getPropertyUtils().setAllowReadOnlyProperties(
            dumperOptions.isAllowReadOnlyProperties());
    representer.setTimeZone(dumperOptions.getTimeZone());
    this.representer = representer;
    this.dumperOptions = dumperOptions;
    this.resolver = resolver;
    this.name = "Yaml:" + System.identityHashCode(this);
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:32,代码来源:Yaml.java

示例2: Yaml

import org.yaml.snakeyaml.representer.Representer; //导入方法依赖的package包/类
/**
 * Create Yaml instance. It is safe to create a few instances and use them
 * in different Threads.
 *
 * @param constructor
 *            BaseConstructor to construct incoming documents
 * @param representer
 *            Representer to emit outgoing objects
 * @param dumperOptions
 *            DumperOptions to configure outgoing objects
 * @param loadingConfig
 *            LoadingConfig to control load behavior
 * @param resolver
 *            Resolver to detect implicit type
 */
public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions,
        LoaderOptions loadingConfig, Resolver resolver) {
    if (!constructor.isExplicitPropertyUtils()) {
        constructor.setPropertyUtils(representer.getPropertyUtils());
    } else if (!representer.isExplicitPropertyUtils()) {
        representer.setPropertyUtils(constructor.getPropertyUtils());
    }
    this.constructor = constructor;
    this.constructor.setAllowDuplicateKeys(loadingConfig.isAllowDuplicateKeys());
    if (dumperOptions.getIndent() <= dumperOptions.getIndicatorIndent()) {
        throw new YAMLException("Indicator indent must be smaller then indent.");
    }
    representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
    representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
    representer.getPropertyUtils()
            .setAllowReadOnlyProperties(dumperOptions.isAllowReadOnlyProperties());
    representer.setTimeZone(dumperOptions.getTimeZone());
    this.representer = representer;
    this.dumperOptions = dumperOptions;
    this.loadingConfig = loadingConfig;
    this.resolver = resolver;
    this.name = "Yaml:" + System.identityHashCode(this);
}
 
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:39,代码来源:Yaml.java

示例3: Yaml

import org.yaml.snakeyaml.representer.Representer; //导入方法依赖的package包/类
/**
 * Create Yaml instance. It is safe to create a few instances and use them
 * in different Threads.
 *
 * @param constructor
 *            BaseConstructor to construct incoming documents
 * @param representer
 *            Representer to emit outgoing objects
 * @param dumperOptions
 *            DumperOptions to configure outgoing objects
 * @param resolver
 *            Resolver to detect implicit type
 */
public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions,
            Resolver resolver) {
    if (!constructor.isExplicitPropertyUtils()) {
        constructor.setPropertyUtils(representer.getPropertyUtils());
    } else if (!representer.isExplicitPropertyUtils()) {
        representer.setPropertyUtils(constructor.getPropertyUtils());
    }
    this.constructor = constructor;
    representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
    representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
    representer.getPropertyUtils().setAllowReadOnlyProperties(
            dumperOptions.isAllowReadOnlyProperties());
    representer.setTimeZone(dumperOptions.getTimeZone());
    this.representer = representer;
    this.dumperOptions = dumperOptions;
    this.resolver = resolver;
    this.name = "Yaml:" + System.identityHashCode(this);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:32,代码来源:Yaml.java

示例4: testWithBlockStyle

import org.yaml.snakeyaml.representer.Representer; //导入方法依赖的package包/类
public void testWithBlockStyle() throws Exception {
    Map<String, Map<String, Object>> rootMap = new HashMap<String, Map<String, Object>>();
    Map<String, Object> enclosedMap = new HashMap<String, Object>();
    enclosedMap.put("world", "test");
    rootMap.put("test", enclosedMap);

    DumperOptions yamlOptions = new DumperOptions();
    yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

    Representer yamlRepresenter = new Representer();
    yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

    Yaml yaml = new Yaml(yamlRepresenter, yamlOptions);
    String output = yaml.dump(rootMap);
    assertEquals("test:\n  world: test\n", output);
}
 
开发者ID:cuizhennan,项目名称:snakeyaml,代码行数:17,代码来源:RecursiveAnchorTest.java

示例5: Yaml

import org.yaml.snakeyaml.representer.Representer; //导入方法依赖的package包/类
/**
 * Create Yaml instance. It is safe to create a few instances and use them in different Threads.
 * 
 * @param constructor
 *            BaseConstructor to construct incoming documents
 * @param representer
 *            Representer to emit outgoing objects
 * @param dumperOptions
 *            DumperOptions to configure outgoing objects
 * @param resolver
 *            Resolver to detect implicit type
 */
public Yaml(final BaseConstructor constructor, final Representer representer, final DumperOptions dumperOptions, final Resolver resolver) {
	if (!constructor.isExplicitPropertyUtils()) {
		constructor.setPropertyUtils(representer.getPropertyUtils());
	} else if (!representer.isExplicitPropertyUtils()) {
		representer.setPropertyUtils(constructor.getPropertyUtils());
	}
	this.constructor = constructor;
	representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
	representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
	representer.getPropertyUtils().setAllowReadOnlyProperties(dumperOptions.isAllowReadOnlyProperties());
	representer.setTimeZone(dumperOptions.getTimeZone());
	this.representer = representer;
	this.dumperOptions = dumperOptions;
	this.resolver = resolver;
	this.name = "Yaml:" + System.identityHashCode(this);
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:29,代码来源:Yaml.java

示例6: YamlConfigLoader

import org.yaml.snakeyaml.representer.Representer; //导入方法依赖的package包/类
private YamlConfigLoader(@NotNull Builder builder, final DumperOptions options, boolean doComments) {
    super(builder, new CommentHandler[] {CommentHandlers.HASH});
    this.commentsEnabled = doComments; // TODO fix broken comment instrumenter D:
    this.options = options;
    representer = new Representer();
    representer.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    this.yaml = new ThreadLocal<Yaml>() {
        @Override
        protected Yaml initialValue() {
            return new Yaml(representer, options);
        }
    };
}
 
开发者ID:dumptruckman,项目名称:dtmlibs,代码行数:14,代码来源:YamlConfigLoader.java

示例7: setupDumper

import org.yaml.snakeyaml.representer.Representer; //导入方法依赖的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

示例8: YAMLProcessor

import org.yaml.snakeyaml.representer.Representer; //导入方法依赖的package包/类
public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) {
	super(new HashMap<String, Object>(), writeDefaults);

	DumperOptions options = new DumperOptions();
	options.setIndent(4);
	options.setDefaultFlowStyle(format.getStyle());
	Representer representer = new Representer();
	representer.setDefaultFlowStyle(format.getStyle());

	yaml = new Yaml(new SafeConstructor(), representer, options);

	this.file = file;
}
 
开发者ID:Afforess,项目名称:sftp-sync,代码行数:14,代码来源:YAMLProcessor.java


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