All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.saumya.mojo.gems.spec.yaml.MappingConstructor Maven / Gradle / Ivy

There is a newer version: 3.0.5
Show newest version
package de.saumya.mojo.gems.spec.yaml;

import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.nodes.Tag;

import de.saumya.mojo.gems.spec.GemDependency;
import de.saumya.mojo.gems.spec.GemRequirement;
import de.saumya.mojo.gems.spec.GemSpecification;
import de.saumya.mojo.gems.spec.GemVersion;

/**
 * A helper for snakeYaml.
 * 
 * @author cstamas
 */
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")));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy