Java 类org.yaml.snakeyaml.resolver.Resolver 实例源码

项目:AndroidApktool    文件:Yaml.java   
/**
 * 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);
}
项目:5zig-TIMV-Plugin    文件:Yaml.java   
/**
 * 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);
}
项目:diorite-configs-java8    文件:Yaml.java   
/**
 * Create Yaml instance. It is safe to create a few instances and use them
 * in different Threads.
 *
 * @param serialization
 *         serialization instance.
 * @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(Serialization serialization, YamlConstructor constructor, Representer representer, DumperOptions dumperOptions, Resolver resolver)
{
    representer.initMultiRepresenters();
    this.serialization = serialization;
    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:" + DioriteThreadUtils.getFullThreadName(Thread.currentThread());
}
项目:snake-yaml    文件:Yaml.java   
/**
 * 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);
}
项目:jpa-unit    文件:YamlDataSetProducer.java   
public Yaml createYamlReader() {
    return new Yaml(new Constructor(), new Representer(), new DumperOptions(), new Resolver() {
        @Override
        protected void addImplicitResolvers() {
            // Intentionally left TIMESTAMP as string to let DBUnit deal with the conversion
            addImplicitResolver(Tag.BOOL, BOOL, "yYnNtTfFoO");
            addImplicitResolver(Tag.INT, INT, "-+0123456789");
            addImplicitResolver(Tag.FLOAT, FLOAT, "-+0123456789.");
            addImplicitResolver(Tag.MERGE, MERGE, "<");
            addImplicitResolver(Tag.NULL, NULL, "~nN\0");
            addImplicitResolver(Tag.NULL, EMPTY, null);
            addImplicitResolver(Tag.VALUE, VALUE, "=");
            addImplicitResolver(Tag.YAML, YAML, "!&*");
        }
    });
}
项目:SubServers-2    文件:Yaml.java   
/**
 * 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);
}
项目:wildfly-swarm    文件:ConfigViewFactory.java   
private static Yaml newYaml() {
    return new Yaml(new Constructor(),
                    new Representer(),
                    new DumperOptions(),
                    new Resolver() {
                        @Override
                        public Tag resolve(NodeId kind, String value, boolean implicit) {
                            if (value != null) {
                                if (value.equalsIgnoreCase("on") ||
                                        value.equalsIgnoreCase("off") ||
                                        value.equalsIgnoreCase("yes") ||
                                        value.equalsIgnoreCase("no")) {
                                    return Tag.STR;
                                }
                            }
                            return super.resolve(kind, value, implicit);
                        }
                    });
}
项目:Diorite    文件:Yaml.java   
/**
 * Create Yaml instance. It is safe to create a few instances and use them
 * in different Threads.
 *
 * @param serialization
 *         serialization instance.
 * @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(Serialization serialization, YamlConstructor constructor, Representer representer, DumperOptions dumperOptions, Resolver resolver)
{
    representer.initMultiRepresenters();
    this.serialization = serialization;
    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:" + DioriteThreadUtils.getFullThreadName(Thread.currentThread());
}
项目:Diorite    文件:Serializer.java   
public Serializer(Serialization serialization, Emitable emitter, Resolver resolver, DumperOptions opts, @Nullable Tag rootTag)
{
    this.serialization = serialization;
    this.emitter = EmitableWrapper.wrap(emitter);
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null)
    {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<>(50);
    this.anchors = new HashMap<>(10);
    this.anchorGenerator = opts.getAnchorGenerator();
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:FastAsyncWorldedit    文件:Yaml.java   
/**
 * 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);
}
项目:snakeyaml    文件:Yaml.java   
/**
 * 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);
}
项目:snakeyaml    文件:PyStructureTest.java   
private List<Node> compose_all(InputStream file) {
    Composer composer = new Composer(new ParserImpl(new StreamReader(new UnicodeReader(file))),
            new Resolver());
    List<Node> documents = new ArrayList<Node>();
    while (composer.checkNode()) {
        documents.add(composer.getNode());
    }
    return documents;
}
项目:TestTheTeacher    文件:Yaml.java   
/**
 * 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);
}
项目:org.openntf.domino    文件:Yaml.java   
/**
 * 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);
}
项目:AndroidApktool    文件:Serializer.java   
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) {
    this.emitter = emitter;
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null) {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<Node>();
    this.anchors = new HashMap<Node, String>();
    this.anchorGenerator = opts.getAnchorGenerator();
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:5zig-TIMV-Plugin    文件:Serializer.java   
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) {
    this.emitter = emitter;
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null) {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<Node>();
    this.anchors = new HashMap<Node, String>();
    this.anchorGenerator = opts.getAnchorGenerator();
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:diorite-configs-java8    文件:Serializer.java   
public Serializer(Serialization serialization, Emitable emitter, Resolver resolver, DumperOptions opts, @Nullable Tag rootTag)
{
    this.serialization = serialization;
    this.emitter = EmitableWrapper.wrap(emitter);
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null)
    {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<>(50);
    this.anchors = new HashMap<>(10);

    // compatibility
    if (! hasAnchorGenerator)
    {
        this.anchorGenerator = new NumberAnchorGenerator();
    }
    else
    {
        Object anchorGenerator = opts.getAnchorGenerator();
        this.anchorGenerator = ((org.yaml.snakeyaml.serializer.AnchorGenerator) anchorGenerator)::nextAnchor;
    }
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:snake-yaml    文件:Serializer.java   
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) {
    this.emitter = emitter;
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null) {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<Node>();
    this.anchors = new HashMap<Node, String>();
    this.anchorGenerator = opts.getAnchorGenerator();
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:snake-yaml    文件:FragmentComposerTest.java   
public void testFragment() {
    String document = "foo:  blargle\n"
            + "developer:  { name: \"Bjarne Stroustrup\", language: \"C++\"}\n"
            + "gee:  [ \"whiz\", \"bang\"]\n";//

    StreamReader reader = new StreamReader(document);
    Composer composer = new FragmentComposer(new ParserImpl(reader), new Resolver(),
            "developer");
    Constructor constructor = new Constructor();
    constructor.setComposer(composer);
    DeveloperBean developer = (DeveloperBean) constructor.getSingleData(DeveloperBean.class);
    assertEquals("Bjarne Stroustrup", developer.name);
    assertEquals("C++", developer.language);
}
项目:snake-yaml    文件:ConstructorMappingTest.java   
private Object construct(Constructor constructor, String data) {
    StreamReader reader = new StreamReader(data);
    Parser parser = new ParserImpl(reader);
    Resolver resolver = new Resolver();
    Composer composer = new Composer(parser, resolver);
    constructor.setComposer(composer);
    return constructor.getSingleData(Object.class);
}
项目:snake-yaml    文件:ConstructorSequenceTest.java   
@SuppressWarnings("unchecked")
private List<Object> construct(Constructor constructor, String data) {
    StreamReader reader = new StreamReader(data);
    Parser parser = new ParserImpl(reader);
    Resolver resolver = new Resolver();
    Composer composer = new Composer(parser, resolver);
    constructor.setComposer(composer);
    List<Object> result = (List<Object>) constructor.getSingleData(Object.class);
    return result;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:YamlPropertySourceLoader.java   
@Override
protected Yaml createYaml() {
    return new Yaml(new StrictMapAppenderConstructor(), new Representer(),
            new DumperOptions(), new Resolver() {
                @Override
                public void addImplicitResolver(Tag tag, Pattern regexp,
                        String first) {
                    if (tag == Tag.TIMESTAMP) {
                        return;
                    }
                    super.addImplicitResolver(tag, regexp, first);
                }
            });
}
项目:SubServers-2    文件:Serializer.java   
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) {
    this.emitter = emitter;
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null) {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<Node>();
    this.anchors = new HashMap<Node, String>();
    this.anchorGenerator = opts.getAnchorGenerator();
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:spring-boot-concourse    文件:YamlPropertySourceLoader.java   
@Override
protected Yaml createYaml() {
    return new Yaml(new StrictMapAppenderConstructor(), new Representer(),
            new DumperOptions(), new Resolver() {
                @Override
                public void addImplicitResolver(Tag tag, Pattern regexp,
                        String first) {
                    if (tag == Tag.TIMESTAMP) {
                        return;
                    }
                    super.addImplicitResolver(tag, regexp, first);
                }
            });
}
项目:contestparser    文件:YamlPropertySourceLoader.java   
@Override
protected Yaml createYaml() {
    return new Yaml(new StrictMapAppenderConstructor(), new Representer(),
            new DumperOptions(), new Resolver() {
                @Override
                public void addImplicitResolver(Tag tag, Pattern regexp,
                        String first) {
                    if (tag == Tag.TIMESTAMP) {
                        return;
                    }
                    super.addImplicitResolver(tag, regexp, first);
                }
            });
}
项目:snakeyaml    文件:Serializer.java   
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) {
    this.emitter = emitter;
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null) {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<Node>();
    this.anchors = new HashMap<Node, String>();
    this.lastAnchorId = 0;
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:snakeyaml    文件:FragmentComposerTest.java   
public void testFragment() {
    String document = "foo:  blargle\n"
            + "developer:  { name: \"Bjarne Stroustrup\", language: \"C++\"}\n"
            + "gee:  [ \"whiz\", \"bang\"]\n";//

    StreamReader reader = new StreamReader(document);
    Composer composer = new FragmentComposer(new ParserImpl(reader), new Resolver(),
            "developer");
    Constructor constructor = new Constructor();
    constructor.setComposer(composer);
    DeveloperBean developer = (DeveloperBean) constructor.getSingleData(DeveloperBean.class);
    assertEquals("Bjarne Stroustrup", developer.name);
    assertEquals("C++", developer.language);
}
项目:snakeyaml    文件:ConstructorMappingTest.java   
private Object construct(Constructor constructor, String data) {
    StreamReader reader = new StreamReader(data);
    Parser parser = new ParserImpl(reader);
    Resolver resolver = new Resolver();
    Composer composer = new Composer(parser, resolver);
    constructor.setComposer(composer);
    return constructor.getSingleData(Object.class);
}
项目:snakeyaml    文件:ConstructorSequenceTest.java   
@SuppressWarnings("unchecked")
private List<Object> construct(Constructor constructor, String data) {
    StreamReader reader = new StreamReader(data);
    Parser parser = new ParserImpl(reader);
    Resolver resolver = new Resolver();
    Composer composer = new Composer(parser, resolver);
    constructor.setComposer(composer);
    List<Object> result = (List<Object>) constructor.getSingleData(Object.class);
    return result;
}
项目:TestTheTeacher    文件:JavaBeanLoader.java   
public JavaBeanLoader(LoaderOptions options, BeanAccess beanAccess) {
    if (options == null) {
        throw new NullPointerException("LoaderOptions must be provided.");
    }
    if (options.getRootTypeDescription() == null) {
        throw new NullPointerException("TypeDescription must be provided.");
    }
    Constructor constructor = new Constructor(options.getRootTypeDescription());
    loader = new Yaml(constructor, options, new Representer(), new DumperOptions(),
            new Resolver());
    loader.setBeanAccess(beanAccess);
}
项目:TestTheTeacher    文件:Serializer.java   
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) {
    this.emitter = emitter;
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null) {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<Node>();
    this.anchors = new HashMap<Node, String>();
    this.lastAnchorId = 0;
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:org.openntf.domino    文件:JavaBeanLoader.java   
public JavaBeanLoader(final LoaderOptions options, final BeanAccess beanAccess) {
    if (options == null) {
        throw new NullPointerException("LoaderOptions must be provided.");
    }
    if (options.getRootTypeDescription() == null) {
        throw new NullPointerException("TypeDescription must be provided.");
    }
    Constructor constructor = new Constructor(options.getRootTypeDescription());
    loader = new Yaml(constructor, options, new Representer(), new DumperOptions(), new Resolver());
    loader.setBeanAccess(beanAccess);
}
项目:org.openntf.domino    文件:Serializer.java   
public Serializer(final Emitable emitter, final Resolver resolver, final DumperOptions opts, final Tag rootTag) {
    this.emitter = emitter;
    this.resolver = resolver;
    this.explicitStart = opts.isExplicitStart();
    this.explicitEnd = opts.isExplicitEnd();
    if (opts.getVersion() != null) {
        this.useVersion = opts.getVersion();
    }
    this.useTags = opts.getTags();
    this.serializedNodes = new HashSet<Node>();
    this.anchors = new HashMap<Node, String>();
    this.lastAnchorId = 0;
    this.closed = null;
    this.explicitRoot = rootTag;
}
项目:AndroidApktool    文件:Composer.java   
public Composer(Parser parser, Resolver resolver) {
    this.parser = parser;
    this.resolver = resolver;
    this.anchors = new HashMap<String, Node>();
    this.recursiveNodes = new HashSet<Node>();
}
项目:5zig-TIMV-Plugin    文件:Composer.java   
public Composer(Parser parser, Resolver resolver) {
    this.parser = parser;
    this.resolver = resolver;
    this.anchors = new HashMap<String, Node>();
    this.recursiveNodes = new HashSet<Node>();
}
项目:5zig-TIMV-Plugin    文件:Yaml.java   
/**
 * Create Yaml instance. It is safe to create a few instances and use them
 * in different Threads.
 */
public Yaml() {
    this(new Constructor(), new Representer(), new DumperOptions(), new LoaderOptions(),
            new Resolver());
}
项目:snake-yaml    文件:Composer.java   
public Composer(Parser parser, Resolver resolver) {
    this.parser = parser;
    this.resolver = resolver;
    this.anchors = new HashMap<String, Node>();
    this.recursiveNodes = new HashSet<Node>();
}
项目:snake-yaml    文件:FragmentComposer.java   
public FragmentComposer(Parser parser, Resolver resolver, String nodeName) {
    super(parser, resolver);
    this.nodeName = nodeName;
}
项目:snake-yaml    文件:SerializerTest.java   
@Override
protected void setUp() {
    DumperOptions config = new DumperOptions();
    StringWriter writer = new StringWriter();
    serializer = new Serializer(new Emitter(writer, config), new Resolver(), config, null);
}
项目:snake-yaml    文件:PyStructureTest.java   
private List<Node> compose_all(InputStream file) {
    Composer composer = new Composer(new ParserImpl(new StreamReader(new UnicodeReader(file))),
            new Resolver());
    List<Node> documents = new ArrayList<Node>();
    while (composer.checkNode()) {
        documents.add(composer.getNode());
    }
    return documents;
}