本文整理汇总了Java中org.yaml.snakeyaml.resolver.Resolver类的典型用法代码示例。如果您正苦于以下问题:Java Resolver类的具体用法?Java Resolver怎么用?Java Resolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Resolver类属于org.yaml.snakeyaml.resolver包,在下文中一共展示了Resolver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Yaml
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
/**
* Create Yaml instance. It is safe to create a few instances and use them
* in different Threads.
*
* @param constructor
* BaseConstructor to construct incoming documents
* @param representer
* Representer to emit outgoing objects
* @param dumperOptions
* DumperOptions to configure outgoing objects
* @param resolver
* Resolver to detect implicit type
*/
public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions,
Resolver resolver) {
if (!constructor.isExplicitPropertyUtils()) {
constructor.setPropertyUtils(representer.getPropertyUtils());
} else if (!representer.isExplicitPropertyUtils()) {
representer.setPropertyUtils(constructor.getPropertyUtils());
}
this.constructor = constructor;
representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
representer.getPropertyUtils().setAllowReadOnlyProperties(
dumperOptions.isAllowReadOnlyProperties());
representer.setTimeZone(dumperOptions.getTimeZone());
this.representer = representer;
this.dumperOptions = dumperOptions;
this.resolver = resolver;
this.name = "Yaml:" + System.identityHashCode(this);
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:32,代码来源:Yaml.java
示例2: Yaml
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
/**
* Create Yaml instance. It is safe to create a few instances and use them
* in different Threads.
*
* @param constructor
* BaseConstructor to construct incoming documents
* @param representer
* Representer to emit outgoing objects
* @param dumperOptions
* DumperOptions to configure outgoing objects
* @param loadingConfig
* LoadingConfig to control load behavior
* @param resolver
* Resolver to detect implicit type
*/
public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions,
LoaderOptions loadingConfig, Resolver resolver) {
if (!constructor.isExplicitPropertyUtils()) {
constructor.setPropertyUtils(representer.getPropertyUtils());
} else if (!representer.isExplicitPropertyUtils()) {
representer.setPropertyUtils(constructor.getPropertyUtils());
}
this.constructor = constructor;
this.constructor.setAllowDuplicateKeys(loadingConfig.isAllowDuplicateKeys());
if (dumperOptions.getIndent() <= dumperOptions.getIndicatorIndent()) {
throw new YAMLException("Indicator indent must be smaller then indent.");
}
representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
representer.getPropertyUtils()
.setAllowReadOnlyProperties(dumperOptions.isAllowReadOnlyProperties());
representer.setTimeZone(dumperOptions.getTimeZone());
this.representer = representer;
this.dumperOptions = dumperOptions;
this.loadingConfig = loadingConfig;
this.resolver = resolver;
this.name = "Yaml:" + System.identityHashCode(this);
}
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:39,代码来源:Yaml.java
示例3: Yaml
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
/**
* Create Yaml instance. It is safe to create a few instances and use them
* in different Threads.
*
* @param serialization
* serialization instance.
* @param constructor
* BaseConstructor to construct incoming documents
* @param representer
* Representer to emit outgoing objects
* @param dumperOptions
* DumperOptions to configure outgoing objects
* @param resolver
* Resolver to detect implicit type
*/
public Yaml(Serialization serialization, YamlConstructor constructor, Representer representer, DumperOptions dumperOptions, Resolver resolver)
{
representer.initMultiRepresenters();
this.serialization = serialization;
if (! constructor.isExplicitPropertyUtils())
{
constructor.setPropertyUtils(representer.getPropertyUtils());
}
else if (! representer.isExplicitPropertyUtils())
{
representer.setPropertyUtils(constructor.getPropertyUtils());
}
this.constructor = constructor;
representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
representer.getPropertyUtils().setAllowReadOnlyProperties(dumperOptions.isAllowReadOnlyProperties());
representer.setTimeZone(dumperOptions.getTimeZone());
this.representer = representer;
this.dumperOptions = dumperOptions;
this.resolver = resolver;
this.name = "Yaml:" + DioriteThreadUtils.getFullThreadName(Thread.currentThread());
}
开发者ID:GotoFinal,项目名称:diorite-configs-java8,代码行数:38,代码来源:Yaml.java
示例4: createYamlReader
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public Yaml createYamlReader() {
return new Yaml(new Constructor(), new Representer(), new DumperOptions(), new Resolver() {
@Override
protected void addImplicitResolvers() {
// Intentionally left TIMESTAMP as string to let DBUnit deal with the conversion
addImplicitResolver(Tag.BOOL, BOOL, "yYnNtTfFoO");
addImplicitResolver(Tag.INT, INT, "-+0123456789");
addImplicitResolver(Tag.FLOAT, FLOAT, "-+0123456789.");
addImplicitResolver(Tag.MERGE, MERGE, "<");
addImplicitResolver(Tag.NULL, NULL, "~nN\0");
addImplicitResolver(Tag.NULL, EMPTY, null);
addImplicitResolver(Tag.VALUE, VALUE, "=");
addImplicitResolver(Tag.YAML, YAML, "!&*");
}
});
}
开发者ID:dadrus,项目名称:jpa-unit,代码行数:17,代码来源:YamlDataSetProducer.java
示例5: newYaml
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
private static Yaml newYaml() {
return new Yaml(new Constructor(),
new Representer(),
new DumperOptions(),
new Resolver() {
@Override
public Tag resolve(NodeId kind, String value, boolean implicit) {
if (value != null) {
if (value.equalsIgnoreCase("on") ||
value.equalsIgnoreCase("off") ||
value.equalsIgnoreCase("yes") ||
value.equalsIgnoreCase("no")) {
return Tag.STR;
}
}
return super.resolve(kind, value, implicit);
}
});
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:20,代码来源:ConfigViewFactory.java
示例6: Serializer
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public Serializer(Serialization serialization, Emitable emitter, Resolver resolver, DumperOptions opts, @Nullable Tag rootTag)
{
this.serialization = serialization;
this.emitter = EmitableWrapper.wrap(emitter);
this.resolver = resolver;
this.explicitStart = opts.isExplicitStart();
this.explicitEnd = opts.isExplicitEnd();
if (opts.getVersion() != null)
{
this.useVersion = opts.getVersion();
}
this.useTags = opts.getTags();
this.serializedNodes = new HashSet<>(50);
this.anchors = new HashMap<>(10);
this.anchorGenerator = opts.getAnchorGenerator();
this.closed = null;
this.explicitRoot = rootTag;
}
开发者ID:Diorite,项目名称:Diorite,代码行数:19,代码来源:Serializer.java
示例7: Yaml
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
/**
* Create Yaml instance. It is safe to create a few instances and use them
* in different Threads.
*
* @param constructor
* BaseConstructor to construct incoming documents
* @param representer
* Representer to emit outgoing objects
* @param dumperOptions
* DumperOptions to configure outgoing objects
* @param resolver
* Resolver to detect implicit type
*/
public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions,
Resolver resolver) {
if (!constructor.isExplicitPropertyUtils()) {
constructor.setPropertyUtils(representer.getPropertyUtils());
} else if (!representer.isExplicitPropertyUtils()) {
representer.setPropertyUtils(constructor.getPropertyUtils());
}
this.constructor = constructor;
representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
representer.getPropertyUtils().setAllowReadOnlyProperties(
dumperOptions.isAllowReadOnlyProperties());
representer.setTimeZone(dumperOptions.getTimeZone());
this.representer = representer;
this.dumperOptions = dumperOptions;
this.resolver = resolver;
this.name = "Yaml:" + System.identityHashCode(this);
}
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:32,代码来源:Yaml.java
示例8: compose_all
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
private List<Node> compose_all(InputStream file) {
Composer composer = new Composer(new ParserImpl(new StreamReader(new UnicodeReader(file))),
new Resolver());
List<Node> documents = new ArrayList<Node>();
while (composer.checkNode()) {
documents.add(composer.getNode());
}
return documents;
}
开发者ID:cuizhennan,项目名称:snakeyaml,代码行数:10,代码来源:PyStructureTest.java
示例9: Yaml
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
/**
* Create Yaml instance. It is safe to create a few instances and use them in different Threads.
*
* @param constructor
* BaseConstructor to construct incoming documents
* @param representer
* Representer to emit outgoing objects
* @param dumperOptions
* DumperOptions to configure outgoing objects
* @param resolver
* Resolver to detect implicit type
*/
public Yaml(final BaseConstructor constructor, final Representer representer, final DumperOptions dumperOptions, final Resolver resolver) {
if (!constructor.isExplicitPropertyUtils()) {
constructor.setPropertyUtils(representer.getPropertyUtils());
} else if (!representer.isExplicitPropertyUtils()) {
representer.setPropertyUtils(constructor.getPropertyUtils());
}
this.constructor = constructor;
representer.setDefaultFlowStyle(dumperOptions.getDefaultFlowStyle());
representer.setDefaultScalarStyle(dumperOptions.getDefaultScalarStyle());
representer.getPropertyUtils().setAllowReadOnlyProperties(dumperOptions.isAllowReadOnlyProperties());
representer.setTimeZone(dumperOptions.getTimeZone());
this.representer = representer;
this.dumperOptions = dumperOptions;
this.resolver = resolver;
this.name = "Yaml:" + System.identityHashCode(this);
}
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:29,代码来源:Yaml.java
示例10: Serializer
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) {
this.emitter = emitter;
this.resolver = resolver;
this.explicitStart = opts.isExplicitStart();
this.explicitEnd = opts.isExplicitEnd();
if (opts.getVersion() != null) {
this.useVersion = opts.getVersion();
}
this.useTags = opts.getTags();
this.serializedNodes = new HashSet<Node>();
this.anchors = new HashMap<Node, String>();
this.anchorGenerator = opts.getAnchorGenerator();
this.closed = null;
this.explicitRoot = rootTag;
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:16,代码来源:Serializer.java
示例11: Serializer
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public Serializer(Serialization serialization, Emitable emitter, Resolver resolver, DumperOptions opts, @Nullable Tag rootTag)
{
this.serialization = serialization;
this.emitter = EmitableWrapper.wrap(emitter);
this.resolver = resolver;
this.explicitStart = opts.isExplicitStart();
this.explicitEnd = opts.isExplicitEnd();
if (opts.getVersion() != null)
{
this.useVersion = opts.getVersion();
}
this.useTags = opts.getTags();
this.serializedNodes = new HashSet<>(50);
this.anchors = new HashMap<>(10);
// compatibility
if (! hasAnchorGenerator)
{
this.anchorGenerator = new NumberAnchorGenerator();
}
else
{
Object anchorGenerator = opts.getAnchorGenerator();
this.anchorGenerator = ((org.yaml.snakeyaml.serializer.AnchorGenerator) anchorGenerator)::nextAnchor;
}
this.closed = null;
this.explicitRoot = rootTag;
}
开发者ID:GotoFinal,项目名称:diorite-configs-java8,代码行数:29,代码来源:Serializer.java
示例12: testFragment
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public void testFragment() {
String document = "foo: blargle\n"
+ "developer: { name: \"Bjarne Stroustrup\", language: \"C++\"}\n"
+ "gee: [ \"whiz\", \"bang\"]\n";//
StreamReader reader = new StreamReader(document);
Composer composer = new FragmentComposer(new ParserImpl(reader), new Resolver(),
"developer");
Constructor constructor = new Constructor();
constructor.setComposer(composer);
DeveloperBean developer = (DeveloperBean) constructor.getSingleData(DeveloperBean.class);
assertEquals("Bjarne Stroustrup", developer.name);
assertEquals("C++", developer.language);
}
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:15,代码来源:FragmentComposerTest.java
示例13: construct
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
private Object construct(Constructor constructor, String data) {
StreamReader reader = new StreamReader(data);
Parser parser = new ParserImpl(reader);
Resolver resolver = new Resolver();
Composer composer = new Composer(parser, resolver);
constructor.setComposer(composer);
return constructor.getSingleData(Object.class);
}
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:9,代码来源:ConstructorMappingTest.java
示例14: construct
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<Object> construct(Constructor constructor, String data) {
StreamReader reader = new StreamReader(data);
Parser parser = new ParserImpl(reader);
Resolver resolver = new Resolver();
Composer composer = new Composer(parser, resolver);
constructor.setComposer(composer);
List<Object> result = (List<Object>) constructor.getSingleData(Object.class);
return result;
}
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:11,代码来源:ConstructorSequenceTest.java
示例15: createYaml
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
@Override
protected Yaml createYaml() {
return new Yaml(new StrictMapAppenderConstructor(), new Representer(),
new DumperOptions(), new Resolver() {
@Override
public void addImplicitResolver(Tag tag, Pattern regexp,
String first) {
if (tag == Tag.TIMESTAMP) {
return;
}
super.addImplicitResolver(tag, regexp, first);
}
});
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:15,代码来源:YamlPropertySourceLoader.java
示例16: Serializer
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) {
this.emitter = emitter;
this.resolver = resolver;
this.explicitStart = opts.isExplicitStart();
this.explicitEnd = opts.isExplicitEnd();
if (opts.getVersion() != null) {
this.useVersion = opts.getVersion();
}
this.useTags = opts.getTags();
this.serializedNodes = new HashSet<Node>();
this.anchors = new HashMap<Node, String>();
this.lastAnchorId = 0;
this.closed = null;
this.explicitRoot = rootTag;
}
开发者ID:cuizhennan,项目名称:snakeyaml,代码行数:16,代码来源:Serializer.java
示例17: JavaBeanLoader
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public JavaBeanLoader(LoaderOptions options, BeanAccess beanAccess) {
if (options == null) {
throw new NullPointerException("LoaderOptions must be provided.");
}
if (options.getRootTypeDescription() == null) {
throw new NullPointerException("TypeDescription must be provided.");
}
Constructor constructor = new Constructor(options.getRootTypeDescription());
loader = new Yaml(constructor, options, new Representer(), new DumperOptions(),
new Resolver());
loader.setBeanAccess(beanAccess);
}
开发者ID:timvisee,项目名称:TestTheTeacher,代码行数:13,代码来源:JavaBeanLoader.java
示例18: JavaBeanLoader
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public JavaBeanLoader(final LoaderOptions options, final BeanAccess beanAccess) {
if (options == null) {
throw new NullPointerException("LoaderOptions must be provided.");
}
if (options.getRootTypeDescription() == null) {
throw new NullPointerException("TypeDescription must be provided.");
}
Constructor constructor = new Constructor(options.getRootTypeDescription());
loader = new Yaml(constructor, options, new Representer(), new DumperOptions(), new Resolver());
loader.setBeanAccess(beanAccess);
}
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:12,代码来源:JavaBeanLoader.java
示例19: Serializer
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public Serializer(final Emitable emitter, final Resolver resolver, final DumperOptions opts, final Tag rootTag) {
this.emitter = emitter;
this.resolver = resolver;
this.explicitStart = opts.isExplicitStart();
this.explicitEnd = opts.isExplicitEnd();
if (opts.getVersion() != null) {
this.useVersion = opts.getVersion();
}
this.useTags = opts.getTags();
this.serializedNodes = new HashSet<Node>();
this.anchors = new HashMap<Node, String>();
this.lastAnchorId = 0;
this.closed = null;
this.explicitRoot = rootTag;
}
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:16,代码来源:Serializer.java
示例20: Composer
import org.yaml.snakeyaml.resolver.Resolver; //导入依赖的package包/类
public Composer(Parser parser, Resolver resolver) {
this.parser = parser;
this.resolver = resolver;
this.anchors = new HashMap<String, Node>();
this.recursiveNodes = new HashSet<Node>();
}
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:7,代码来源:Composer.java
注:本文中的org.yaml.snakeyaml.resolver.Resolver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论