Package org.yaml.snakeyaml.nodes

Examples of org.yaml.snakeyaml.nodes.Tag


            } else {
                resolvers = yamlImplicitResolvers.get(value.charAt(0));
            }
            if (resolvers != null) {
                for (ResolverTuple v : resolvers) {
                    Tag tag = v.getTag();
                    Pattern regexp = v.getRegexp();
                    if (regexp.matcher(value).matches()) {
                        return tag;
                    }
                }
            }
            if (yamlImplicitResolvers.containsKey(null)) {
                for (ResolverTuple v : yamlImplicitResolvers.get(null)) {
                    Tag tag = v.getTag();
                    Pattern regexp = v.getRegexp();
                    if (regexp.matcher(value).matches()) {
                        return tag;
                    }
                }
View Full Code Here


    public Object getSingleData(Class<?> type) {
        // Ensure that the stream contains a single document and construct it
        Node node = composer.getSingleNode();
        if (node != null) {
            if (Object.class != type) {
                node.setTag(new Tag(type));
            } else if (rootTag != null) {
                node.setTag(rootTag);
            }
            return constructDocument(node);
        }
View Full Code Here

     *            tag to be used for the root node. (JavaBeans may use
     *            Tag.MAP="tag:yaml.org,2002:map")
     * @deprecated use Tag instead of String
     */
    public void setExplicitRoot(String expRoot) {
        setExplicitRoot(new Tag(expRoot));
    }
View Full Code Here

     *            a sequence of possible initial characters or null (which means
     *            any).
     *
     */
    public void addImplicitResolver(String tag, Pattern regexp, String first) {
        addImplicitResolver(new Tag(tag), regexp, first);
    }
View Full Code Here

        keyProperties = new HashMap<String, Class<? extends Object>>();
        valueProperties = new HashMap<String, Class<? extends Object>>();
    }

    public TypeDescription(Class<? extends Object> clazz, String tag) {
        this(clazz, new Tag(tag));
    }
View Full Code Here

    public void setTag(Tag tag) {
        this.tag = tag;
    }

    public void setTag(String tag) {
        setTag(new Tag(tag));
    }
View Full Code Here

        super();

        this.nullRepresenter = new RepresentNull();

        this.addClassTag(GemSpecification.class,
                         new Tag("!ruby/object:Gem::Specification"));
        this.addClassTag(GemDependency.class,
                         new Tag("!ruby/object:Gem::Dependency"));
        this.addClassTag(GemRequirement.class,
                         new Tag("!ruby/object:Gem::Requirement"));
        this.addClassTag(GemVersion.class, new Tag("!ruby/object:Gem::Version"));
    }
View Full Code Here

public class MappingConstructor extends Constructor {
    public MappingConstructor() {
        super();

        this.addTypeDescription(new TypeDescription(GemSpecification.class,
                new Tag("!ruby/object:Gem::Specification")));
        this.addTypeDescription(new TypeDescription(GemDependency.class,
                new Tag("!ruby/object:Gem::Dependency")));
        this.addTypeDescription(new TypeDescription(GemRequirement.class,
                new Tag("!ruby/object:Gem::Requirement")));
        this.addTypeDescription(new TypeDescription(GemVersion.class,
                new Tag("!ruby/object:Gem::Version")));
    }
View Full Code Here

    private static class RegisterTags extends SafeConstructor
    {
        private boolean recursing;

        RegisterTags() {
            yamlConstructors.put(new Tag("!dc"), new ConstructDontCare());
            yamlConstructors.put(new Tag("!re"), new ConstructRegexp());
            yamlConstructors.put(new Tag("!select-engine"), new ConstructSelectEngine());
            yamlConstructors.put(new Tag("!date"), new ConstructSystemDate());
            yamlConstructors.put(new Tag("!time"), new ConstructSystemTime());
            yamlConstructors.put(new Tag("!datetime"), new ConstructSystemDateTime());
            yamlConstructors.put(new Tag("!unicode"), new ConstructUnicode());
            yamlConstructors.put(new Tag("!utf8-bytes"), new ConstructUTF8Bytes());
        }
View Full Code Here

TOP

Related Classes of org.yaml.snakeyaml.nodes.Tag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.