Examples of DumperOptions


Examples of org.yaml.snakeyaml.DumperOptions

        config.load(new StringReader(this.getTestInputData()));
        assertEquals(Arrays.asList("testUser1-Data", "testUser2-Data"), config.getList("users.user.item"));
    }

    private String getTestInputData() {
        final DumperOptions yamlOptions = new DumperOptions();
        Yaml yaml = new Yaml(yamlOptions);

        yamlOptions.setIndent(YamlConfiguration.DEFAULT_IDENT);
        yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

        return yaml.dump(this.getTestData());
    }
View Full Code Here

Examples of org.yaml.snakeyaml.DumperOptions

        // of cassandra.yaml would result in parsing errors. Given these problems, I decided
        // to go with the untyped approach for updating cassandra.yaml for now.
        //
        // jsanda

        DumperOptions options = new DumperOptions();
        options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
        Yaml yaml = new Yaml(options);
        Map cassandraConfig = (Map) yaml.load(new FileInputStream(yamlFile));

        List seedProviderList = (List) cassandraConfig.get("seed_provider");
        Map seedProvider = (Map) seedProviderList.get(0);
View Full Code Here

Examples of org.yaml.snakeyaml.DumperOptions

    }

    public void load() {
        FileInputStream inputStream = null;
        try {
            DumperOptions options = new DumperOptions();
            options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
            yaml = new Yaml(options);
            inputStream = new FileInputStream(configFile);
            config = (Map) yaml.load(inputStream);
            createBackup();
        } catch (FileNotFoundException e) {
View Full Code Here

Examples of org.yaml.snakeyaml.DumperOptions

            }
            // 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

Examples of org.yaml.snakeyaml.DumperOptions

        super(runtime, klass);
    }

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

        return context.nil;
    }
View Full Code Here

Examples of org.yaml.snakeyaml.DumperOptions

            }
            // 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

Examples of org.yaml.snakeyaml.DumperOptions

    }

    NaturalPropertyUtils propertyUtils = new NaturalPropertyUtils();
    representer.setPropertyUtils(propertyUtils);

    DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(FlowStyle.BLOCK);

    return new org.yaml.snakeyaml.Yaml(
        new Constructor(),
        representer,
        options,
View Full Code Here

Examples of org.yaml.snakeyaml.DumperOptions

      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

Examples of org.yaml.snakeyaml.DumperOptions

      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

Examples of org.yaml.snakeyaml.DumperOptions

    }

    NaturalPropertyUtils propertyUtils = new NaturalPropertyUtils();
    representer.setPropertyUtils(propertyUtils);

    DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(FlowStyle.BLOCK);

    return new org.yaml.snakeyaml.Yaml(
        new Constructor(),
        representer,
        options,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.