Java 类org.yaml.snakeyaml.constructor.Construct 实例源码

项目:exam    文件:JodaPropertyConstructor.java   
@Override
public Object construct(Node nnode) {

    if (nnode.getTag() == Tag.TIMESTAMP) {
        Construct dateConstructor = yamlConstructors.get(Tag.TIMESTAMP);
        if (nnode.getType().isAssignableFrom(DateTime.class)) {
            Date date = (Date) dateConstructor.construct(nnode);
            return new DateTime(date, DateTimeZone.UTC);
        } else {
            return dateConstructor.construct(nnode);
        }
    } else {
        return super.construct(nnode);
    }
}
项目:snake-yaml    文件:JodaTimeExampleTest.java   
@Override
public Object construct(Node nnode) {
    if (nnode.getTag().equals("tag:yaml.org,2002:timestamp")) {
        Construct dateConstructor = yamlConstructors.get(Tag.TIMESTAMP);
        Date date = (Date) dateConstructor.construct(nnode);
        return new DateTime(date, DateTimeZone.UTC);
    } else {
        return super.construct(nnode);
    }
}
项目:snake-yaml    文件:JodaTimeFlowStylesTest.java   
@Override
public Object construct(Node nnode) {
    if (nnode.getTag().equals(new Tag("tag:yaml.org,2002:timestamp"))) {
        Construct dateConstructor = yamlConstructors.get(Tag.TIMESTAMP);
        Date date = (Date) dateConstructor.construct(nnode);
        return new DateTime(date, DateTimeZone.UTC);
    } else {
        return super.construct(nnode);
    }
}
项目:snake-yaml    文件:PerlTest.java   
protected Construct getConstructor(Node node) {
    if (node.getTag().equals(new Tag("!de.oddb.org,2007/ODDB::Util::Code"))) {
        node.setUseClassConstructor(true);
        node.setType(CodeBean.class);
    }
    return super.getConstructor(node);
}
项目:snake-yaml    文件:ChangeRuntimeClassTest.java   
private Construct getConstructor(Node node) {
    Class<?> cl = getClassForNode(node);
    if (cl.equals(Entity.class) && true) {
        // today's temperature is high :)
        cl = EntityLoadingProxy.class;
    }
    node.setType(cl);
    // call the constructor as if the runtime class is defined
    Construct constructor = yamlClassConstructors.get(node.getNodeId());
    return constructor;
}
项目:Diorite-old    文件:TemplateYamlConstructor.java   
/**
 * Unsafe version of {@link #constructObject(Node)}
 *
 * @param node Node to be constructed
 *
 * @return Java instance
 */
public Object unsafeConstructObject(final Node node)
{
    final Construct constructor = this.getConstructor(node);
    final Object data = constructor.construct(node);
    if (node.isTwoStepsConstruction())
    {
        constructor.construct2ndStep(node, data);
    }
    return data;
}
项目:snakeyaml    文件:JodaTimeExampleTest.java   
@Override
public Object construct(Node nnode) {
    if (nnode.getTag().equals("tag:yaml.org,2002:timestamp")) {
        Construct dateConstructor = yamlConstructors.get(Tag.TIMESTAMP);
        Date date = (Date) dateConstructor.construct(nnode);
        return new DateTime(date, DateTimeZone.UTC);
    } else {
        return super.construct(nnode);
    }
}
项目:snakeyaml    文件:JodaTimeFlowStylesTest.java   
@Override
public Object construct(Node nnode) {
    if (nnode.getTag().equals(new Tag("tag:yaml.org,2002:timestamp"))) {
        Construct dateConstructor = yamlConstructors.get(Tag.TIMESTAMP);
        Date date = (Date) dateConstructor.construct(nnode);
        return new DateTime(date, DateTimeZone.UTC);
    } else {
        return super.construct(nnode);
    }
}
项目:snakeyaml    文件:PerlTest.java   
protected Construct getConstructor(Node node) {
    if (node.getTag().equals(new Tag("!de.oddb.org,2007/ODDB::Util::Code"))) {
        node.setUseClassConstructor(true);
        node.setType(CodeBean.class);
    }
    return super.getConstructor(node);
}
项目:snakeyaml    文件:ChangeRuntimeClassTest.java   
private Construct getConstructor(Node node) {
    Class<?> cl = getClassForNode(node);
    if (cl.equals(Entity.class) && true) {
        // today's temperature is high :)
        cl = EntityLoadingProxy.class;
    }
    node.setType(cl);
    // call the constructor as if the runtime class is defined
    Construct constructor = yamlClassConstructors.get(node.getNodeId());
    return constructor;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(BuildPathElement.class);

    String path = getPath(node);
    String buildPath = getPath(node, "buildPath"); //$NON-NLS-1$
    BuildPathElement bpe = new BuildPathElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, bpe);
    bpe.setPath(path);
    bpe.setBuildPath(buildPath);
    return bpe;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(BundleElement.class);
    String path = getPath(node);
    BundleElement be = new BundleElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    return be;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(CommandElement.class);
    String path = getPath(node);
    CommandElement be = new LazyCommandElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    setPrefixTriggers(node, be);
    return be;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(SnippetElement.class);
    String path = getPath(node);
    SnippetElement be = new SnippetElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    setPrefixTriggers(node, be);
    return be;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(SnippetCategoryElement.class);
    String path = getPath(node);
    SnippetCategoryElement sce = new SnippetCategoryElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, sce);
    sce.setPath(path);
    return sce;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(MenuElement.class);
    String path = getPath(node);
    MenuElement be = new MenuElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    forcePathsOfChildren(be.getChildren());
    return be;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(ProjectTemplateElement.class);
    String path = getPath(node);
    ProjectTemplateElement be = new ProjectTemplateElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    return be;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(ProjectSampleElement.class);
    String path = getPath(node);
    ProjectSampleElement be = new ProjectSampleElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    return be;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(EnvironmentElement.class);
    String path = getPath(node);
    EnvironmentElement be = new LazyEnvironmentElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    return be;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(TemplateElement.class);
    String path = getPath(node);
    TemplateElement be = new LazyTemplateElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    setPrefixTriggers(node, be);
    return be;
}
项目:APICloud-Studio    文件:BundleCacher.java   
public Object construct(Node node)
{
    node.setType(ContentAssistElement.class);
    String path = getPath(node);
    ContentAssistElement be = new LazyContentAssistElement(path);
    Construct mappingConstruct = yamlClassConstructors.get(NodeId.mapping);
    mappingConstruct.construct2ndStep(node, be);
    be.setPath(path);
    setPrefixTriggers(node, be);
    return be;
}
项目:yaml    文件:YamlNodeConstructor.java   
/**
 * Creates a new {@link Construct} for {@code !!binary}.
 *
 * @return the construct
 */
protected Construct binaryConstruct() {
    String linebreak = getOptions().getLineBreak().getString();
    int width = getOptions().getWidth();
    BaseEncoding encoding = BaseEncoding.base64()
            .withSeparator(linebreak, width);
    return new YamlBinaryNodeConstruct(getNodeFactory(), this, encoding);
}
项目:t4f-data    文件:JodaTimeExampleTest.java   
@Override
public Object construct(Node nnode) {
    if (nnode.getTag().equals("tag:yaml.org,2002:timestamp")) {
        Construct dateConstructor = yamlConstructors.get(Tag.TIMESTAMP);
        Date date = (Date) dateConstructor.construct(nnode);
        return new DateTime(date, DateTimeZone.UTC);
    } else {
        return super.construct(nnode);
    }
}
项目:t4f-data    文件:JodaTimeFlowStylesTest.java   
@Override
public Object construct(Node nnode) {
    if (nnode.getTag().equals("tag:yaml.org,2002:timestamp")) {
        Construct dateConstructor = yamlConstructors.get(Tag.TIMESTAMP);
        Date date = (Date) dateConstructor.construct(nnode);
        return new DateTime(date, DateTimeZone.UTC);
    } else {
        return super.construct(nnode);
    }
}
项目:AndroidApktool    文件:CompactConstructor.java   
private Construct getCompactConstruct() {
    if (compactConstruct == null) {
        compactConstruct = createCompactConstruct();
    }
    return compactConstruct;
}
项目:AndroidApktool    文件:CompactConstructor.java   
protected Construct createCompactConstruct() {
    return new ConstructCompactObject();
}
项目:5zig-TIMV-Plugin    文件:CompactConstructor.java   
private Construct getCompactConstruct() {
    if (compactConstruct == null) {
        compactConstruct = createCompactConstruct();
    }
    return compactConstruct;
}
项目:5zig-TIMV-Plugin    文件:CompactConstructor.java   
protected Construct createCompactConstruct() {
    return new ConstructCompactObject();
}
项目:diorite-configs-java8    文件:YamlConstructor.java   
public void addConstruct(Class<?> type, Construct construct)
{
    this.yamlConstructors.put(new Tag(type), construct);
}
项目:snake-yaml    文件:CompactConstructor.java   
private Construct getCompactConstruct() {
    if (compactConstruct == null) {
        compactConstruct = createCompactConstruct();
    }
    return compactConstruct;
}
项目:snake-yaml    文件:CompactConstructor.java   
protected Construct createCompactConstruct() {
    return new ConstructCompactObject();
}
项目:snake-yaml    文件:ImplicitResolverTest.java   
protected Construct getConstructor(Node node) {
    if (CFG.equals(node.getTag())) {
        node.setUseClassConstructor(false);
    }
    return super.getConstructor(node);
}
项目:Diorite-old    文件:TemplateYamlConstructor.java   
@Override
public Construct getConstructor(final Node node)
{
    return super.getConstructor(node);
}
项目:SubServers-2    文件:CompactConstructor.java   
private Construct getCompactConstruct() {
    if (compactConstruct == null) {
        compactConstruct = createCompactConstruct();
    }
    return compactConstruct;
}
项目:SubServers-2    文件:CompactConstructor.java   
protected Construct createCompactConstruct() {
    return new ConstructCompactObject();
}
项目:Diorite    文件:YamlConstructor.java   
public void addConstruct(Class<?> type, Construct construct)
{
    this.yamlConstructors.put(new Tag(type), construct);
}
项目:snakeyaml    文件:CompactConstructor.java   
private Construct getCompactConstruct() {
    if (compactConstruct == null) {
        compactConstruct = createCompactConstruct();
    }
    return compactConstruct;
}
项目:snakeyaml    文件:CompactConstructor.java   
protected Construct createCompactConstruct() {
    return new ConstructCompactObject();
}
项目:snakeyaml    文件:ImplicitResolverTest.java   
protected Construct getConstructor(Node node) {
    if (CFG.equals(node.getTag())) {
        node.setUseClassConstructor(false);
    }
    return super.getConstructor(node);
}
项目:TestTheTeacher    文件:CompactConstructor.java   
private Construct getCompactConstruct() {
    if (compactConstruct == null) {
        compactConstruct = createCompactConstruct();
    }
    return compactConstruct;
}