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


Java Construct类代码示例

本文整理汇总了Java中org.yaml.snakeyaml.constructor.Construct的典型用法代码示例。如果您正苦于以下问题:Java Construct类的具体用法?Java Construct怎么用?Java Construct使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: construct

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:CSCfi,项目名称:exam,代码行数:16,代码来源:JodaPropertyConstructor.java

示例2: construct

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:11,代码来源:JodaTimeExampleTest.java

示例3: construct

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:11,代码来源:JodaTimeFlowStylesTest.java

示例4: getConstructor

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
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);
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:8,代码来源:PerlTest.java

示例5: getConstructor

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
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;
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:12,代码来源:ChangeRuntimeClassTest.java

示例6: unsafeConstructObject

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:Diorite,项目名称:Diorite-old,代码行数:18,代码来源:TemplateYamlConstructor.java

示例7: construct

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
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;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:14,代码来源:BundleCacher.java

示例8: binaryConstruct

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:autermann,项目名称:yaml,代码行数:13,代码来源:YamlNodeConstructor.java

示例9: getCompactConstruct

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
private Construct getCompactConstruct() {
    if (compactConstruct == null) {
        compactConstruct = createCompactConstruct();
    }
    return compactConstruct;
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:7,代码来源:CompactConstructor.java

示例10: createCompactConstruct

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
protected Construct createCompactConstruct() {
    return new ConstructCompactObject();
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:4,代码来源:CompactConstructor.java

示例11: addConstruct

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
public void addConstruct(Class<?> type, Construct construct)
{
    this.yamlConstructors.put(new Tag(type), construct);
}
 
开发者ID:GotoFinal,项目名称:diorite-configs-java8,代码行数:5,代码来源:YamlConstructor.java

示例12: getConstructor

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
protected Construct getConstructor(Node node) {
    if (CFG.equals(node.getTag())) {
        node.setUseClassConstructor(false);
    }
    return super.getConstructor(node);
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:7,代码来源:ImplicitResolverTest.java

示例13: getConstructor

import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
@Override
public Construct getConstructor(final Node node)
{
    return super.getConstructor(node);
}
 
开发者ID:Diorite,项目名称:Diorite-old,代码行数:6,代码来源:TemplateYamlConstructor.java


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