本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例9: getCompactConstruct
import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
private Construct getCompactConstruct() {
if (compactConstruct == null) {
compactConstruct = createCompactConstruct();
}
return compactConstruct;
}
示例10: createCompactConstruct
import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
protected Construct createCompactConstruct() {
return new ConstructCompactObject();
}
示例11: addConstruct
import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
public void addConstruct(Class<?> type, Construct construct)
{
this.yamlConstructors.put(new Tag(type), construct);
}
示例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);
}
示例13: getConstructor
import org.yaml.snakeyaml.constructor.Construct; //导入依赖的package包/类
@Override
public Construct getConstructor(final Node node)
{
return super.getConstructor(node);
}