Package org.yaml.snakeyaml

Examples of org.yaml.snakeyaml.DumperOptions


  private String  header  = null;

  public Configuration(File file) {
    super(new HashMap<String, Object>());

    DumperOptions options = new DumperOptions();

    options.setIndent(4);
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

    yaml = new Yaml(new SafeConstructor(), new EmptyNullRepresenter(), options);

    this.file = file;
  }
View Full Code Here


            }
            // whew.
            keyspaces.add(rks);
        }
       
        DumperOptions options = new DumperOptions();
        /* Use a block YAML arrangement */
        options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
        SkipNullRepresenter representer = new SkipNullRepresenter();
        /* Use Tag.MAP to avoid the class name being included as global tag */
        representer.addClassTag(RawColumnFamily.class, Tag.MAP);
        representer.addClassTag(Keyspaces.class, Tag.MAP);
        representer.addClassTag(ColumnDefinition.class, Tag.MAP);
View Full Code Here

      return value;
   }

   protected List<?> loadYamlData(final Reader io) throws IOException {
      final Yaml yaml = new Yaml(new Constructor(), new Representer(),
            new DumperOptions(), new YamlParserResolver());
      final Object loadedYaml = yaml.load(io);

      if (loadedYaml instanceof ArrayList) {
         return (ArrayList<?>) loadedYaml;
      }
View Full Code Here

        super(runtime, klass);
    }

    @JRubyMethod(visibility = PRIVATE)
    public IRubyObject initialize(ThreadContext context, IRubyObject io) {
        options = new DumperOptions();
        options.setIndent(2);

        this.io = io;

        return context.nil;
View Full Code Here

    public IRubyObject initialize(ThreadContext context, IRubyObject io, IRubyObject rbOptions) {
        IRubyObject width     = rbOptions.callMethod(context, "line_width");
        IRubyObject canonical = rbOptions.callMethod(context, "canonical");
        IRubyObject level     = rbOptions.callMethod(context, "indentation");

        options = new DumperOptions();

        options.setCanonical(canonical.isTrue());
        options.setIndent((int)level.convertToInteger().getLongValue());
        options.setWidth((int)width.convertToInteger().getLongValue());
View Full Code Here

  protected WritableConfiguration(File file, Representer rep) {
    super(file);
    this.file = file;

    // make config files look nicer
    DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    yaml = new Yaml(new SafeConstructor(), rep, options);

  }
View Full Code Here

  protected WritableConfiguration(File file, Representer rep) {
    super(file);
    this.file = file;

    // make config files look nicer
    DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    yaml = new Yaml(rep, options);

  }
View Full Code Here

            }
            // whew.
            keyspaces.add(rks);
        }
       
        DumperOptions options = new DumperOptions();
        /* Use a block YAML arrangement */
        options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
        SkipNullRepresenter representer = new SkipNullRepresenter();
        /* Use Tag.MAP to avoid the class name being included as global tag */
        representer.addClassTag(RawColumnFamily.class, Tag.MAP);
        representer.addClassTag(Keyspaces.class, Tag.MAP);
        representer.addClassTag(ColumnDefinition.class, Tag.MAP);
View Full Code Here

  @Nullable
  private static Map<String, Object> loadPubspecYamlInfo(final @NotNull String pubspecYamlFileContents) {
    // see com.google.dart.tools.core.utilities.yaml.PubYamlUtils#parsePubspecYamlToMap()
    // deprecated constructor used to be compatible with old snakeyaml version in testng.jar (it wins when running from sources or tests)
    //noinspection deprecation
    final Yaml yaml = new Yaml(new Loader(new Constructor()), new Dumper(new Representer(), new DumperOptions()), new Resolver() {
      @Override
      protected void addImplicitResolvers() {
        addImplicitResolver(Tag.NULL, NULL, "~nN\0");
        addImplicitResolver(Tag.NULL, EMPTY, null);
        addImplicitResolver(Tag.VALUE, VALUE, "=");
View Full Code Here

  private File file;

  public Configuration(File file) {
    super(new HashMap<String, Object>());

    DumperOptions options = new DumperOptions();

    options.setIndent(4);
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

    yaml = new Yaml(new SafeConstructor(), new Representer(), options);

    this.file = file;
  }
View Full Code Here

TOP

Related Classes of org.yaml.snakeyaml.DumperOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.