org.yaml.snakeyaml.resolver.Resolver.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.yaml.snakeyaml.resolver.Resolver.<init>方法的一些代码示例,展示了Resolver.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resolver.<init>方法的具体详情如下:
包路径:org.yaml.snakeyaml.resolver.Resolver
类名称:Resolver
方法名:<init>

Resolver.<init>介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param constructor
  6. * BaseConstructor to construct incoming documents
  7. * @param representer
  8. * Representer to emit outgoing objects
  9. * @param dumperOptions
  10. * DumperOptions to configure outgoing objects
  11. * @param loadingConfig
  12. * LoadingConfig to control load behavior
  13. */
  14. public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions,
  15. LoaderOptions loadingConfig) {
  16. this(constructor, representer, dumperOptions, loadingConfig, new Resolver());
  17. }

代码示例来源:origin: redisson/redisson

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param constructor
  6. * BaseConstructor to construct incoming documents
  7. * @param representer
  8. * Representer to emit outgoing objects
  9. * @param dumperOptions
  10. * DumperOptions to configure outgoing objects
  11. */
  12. public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions) {
  13. this(constructor, representer, dumperOptions, new LoaderOptions(), new Resolver());
  14. }

代码示例来源:origin: redisson/redisson

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param representer
  6. * Representer to emit outgoing objects
  7. * @param dumperOptions
  8. * DumperOptions to configure outgoing objects
  9. */
  10. public Yaml(Representer representer, DumperOptions dumperOptions) {
  11. this(new Constructor(), representer, dumperOptions, new LoaderOptions(), new Resolver());
  12. }

代码示例来源:origin: redisson/redisson

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. */
  5. public Yaml() {
  6. this(new Constructor(), new Representer(), new DumperOptions(), new LoaderOptions(),
  7. new Resolver());
  8. }

代码示例来源:origin: stackoverflow.com

  1. var Resolver = require('async-resolve');
  2. var resolver_obj = new Resolver();
  3. resolver_obj.resolve('module', __dirname, function(err, filename) {
  4. return console.log(filename);
  5. });

代码示例来源:origin: pl.droidsonroids.yaml/snakeyaml

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param constructor
  6. * BaseConstructor to construct incoming documents
  7. * @param representer
  8. * Representer to emit outgoing objects
  9. * @param dumperOptions
  10. * DumperOptions to configure outgoing objects
  11. */
  12. public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions) {
  13. this(constructor, representer, dumperOptions, new Resolver());
  14. }

代码示例来源:origin: harbby/presto-connectors

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param constructor
  6. * BaseConstructor to construct incoming documents
  7. * @param representer
  8. * Representer to emit outgoing objects
  9. * @param dumperOptions
  10. * DumperOptions to configure outgoing objects
  11. */
  12. public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions) {
  13. this(constructor, representer, dumperOptions, new Resolver());
  14. }

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param constructor
  6. * BaseConstructor to construct incoming documents
  7. * @param representer
  8. * Representer to emit outgoing objects
  9. * @param dumperOptions
  10. * DumperOptions to configure outgoing objects
  11. * @param loadingConfig
  12. * LoadingConfig to control load behavior
  13. */
  14. public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions,
  15. LoaderOptions loadingConfig) {
  16. this(constructor, representer, dumperOptions, loadingConfig, new Resolver());
  17. }

代码示例来源:origin: stackoverflow.com

  1. DocumentBuilder builder = factory.newDocumentBuilder();
  2. Resolver res = new Resolver();
  3. builder.setEntityResolver(res);
  4. Document doc = builder.parse("YOUR XML FILE");

代码示例来源:origin: pl.droidsonroids.yaml/snakeyaml

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param representer
  6. * Representer to emit outgoing objects
  7. * @param dumperOptions
  8. * DumperOptions to configure outgoing objects
  9. */
  10. public Yaml(Representer representer, DumperOptions dumperOptions) {
  11. this(new Constructor(), representer, dumperOptions, new Resolver());
  12. }

代码示例来源:origin: harbby/presto-connectors

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param representer
  6. * Representer to emit outgoing objects
  7. * @param dumperOptions
  8. * DumperOptions to configure outgoing objects
  9. */
  10. public Yaml(Representer representer, DumperOptions dumperOptions) {
  11. this(new Constructor(), representer, dumperOptions, new Resolver());
  12. }

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param constructor
  6. * BaseConstructor to construct incoming documents
  7. * @param representer
  8. * Representer to emit outgoing objects
  9. * @param dumperOptions
  10. * DumperOptions to configure outgoing objects
  11. */
  12. public Yaml(BaseConstructor constructor, Representer representer, DumperOptions dumperOptions) {
  13. this(constructor, representer, dumperOptions, new LoaderOptions(), new Resolver());
  14. }

代码示例来源:origin: stackoverflow.com

  1. InputStream parsingStream = new FileInputStream(file)
  2. DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
  3. builder.setEntityResolver(new Resolver());
  4. Document doc = builder.parse( parsingStream );
  5. ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
  6. DOMImplementationLS domImplementationLS = (DOMImplementationLS)doc.getImplementation().getFeature( "LS", "3.0" );
  7. LSOutput lsOutput = domImplementationLS.createLSOutput();
  8. lsOutput.setByteStream( outputStream );
  9. LSSerializer lsSerializer = domImplementationLS.createLSSerializer();
  10. lsSerializer.write( doc, lsOutput );
  11. byte[] byteArray = outputStream.toByteArray();
  12. ByteArrayInputStream importStream = new ByteArrayInputStream( byteArray );
  13. Preferences.importPreferences( importStream );

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. *
  5. * @param representer
  6. * Representer to emit outgoing objects
  7. * @param dumperOptions
  8. * DumperOptions to configure outgoing objects
  9. */
  10. public Yaml(Representer representer, DumperOptions dumperOptions) {
  11. this(new Constructor(), representer, dumperOptions, new LoaderOptions(), new Resolver());
  12. }

代码示例来源:origin: sonatype-nexus-community/nexus-repository-helm

  1. public void write(final OutputStream os, final ChartIndex index) {
  2. try (OutputStreamWriter writer = new OutputStreamWriter(os)) {
  3. Yaml yaml = new Yaml(new JodaPropertyConstructor(),
  4. setupRepresenter(),
  5. new DumperOptions(),
  6. new Resolver());
  7. String result = yaml.dumpAsMap(index);
  8. writer.write(result);
  9. }
  10. catch (IOException ex) {
  11. log.error("Unable to write to OutputStream for index.yaml", ex);
  12. }
  13. }

代码示例来源:origin: sonatype-nexus-community/nexus-repository-helm

  1. public Map<String, Object> load(InputStream is) throws IOException {
  2. checkNotNull(is);
  3. String data = IOUtils.toString(new UnicodeReader(is));
  4. Map<String, Object> map;
  5. try {
  6. Yaml yaml = new Yaml(new Constructor(), new Representer(),
  7. new DumperOptions(), new Resolver());
  8. map = (Map<String, Object>) yaml.load(data);
  9. }
  10. catch (YAMLException e) {
  11. map = (Map<String, Object>) mapper.readValue(data, Map.class);
  12. }
  13. return map;
  14. }

代码示例来源:origin: harbby/presto-connectors

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. */
  5. public Yaml() {
  6. this(new Constructor(), new Representer(), new DumperOptions(), new Resolver());
  7. }

代码示例来源:origin: pl.droidsonroids.yaml/snakeyaml

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. */
  5. public Yaml() {
  6. this(new Constructor(), new Representer(), new DumperOptions(), new Resolver());
  7. }

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. /**
  2. * Create Yaml instance. It is safe to create a few instances and use them
  3. * in different Threads.
  4. */
  5. public Yaml() {
  6. this(new Constructor(), new Representer(), new DumperOptions(), new LoaderOptions(),
  7. new Resolver());
  8. }

代码示例来源:origin: org.onehippo.cms/hippo-configuration-management-model

  1. public void serializeNode(final Writer writer, final Node node) throws IOException {
  2. final DumperOptions dumperOptions = new DumperOptions();
  3. if (explicitSequencing) {
  4. dumperOptions.setIndicatorIndent(2);
  5. dumperOptions.setIndent(4);
  6. } else {
  7. dumperOptions.setIndicatorIndent(0);
  8. dumperOptions.setIndent(2);
  9. }
  10. final Resolver resolver = new Resolver();
  11. final Serializer serializer = new Serializer(new Emitter(writer, dumperOptions), resolver, dumperOptions, null);
  12. serializer.open();
  13. serializer.serialize(node);
  14. serializer.close();
  15. }

相关文章