Package org.yaml.snakeyaml.representer

Examples of org.yaml.snakeyaml.representer.Representer


    this.format = format;

    DumperOptions options = new FancyDumperOptions();
    options.setIndent(4);
    options.setDefaultFlowStyle(format.getStyle());
    Representer representer = new FancyRepresenter();
    representer.setDefaultFlowStyle(format.getStyle());

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

    this.file = file;
  }
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

        confTo.set(Pig8CubeIncrementalCompilerBean.PROP_CUBEMODEL, encodeCubeModel(yamlStr));
    }

    private static Yaml getYaml() {
        Constructor c = new Constructor(SimpleCube.class);
        Representer rp = new Representer();

        // understand !SimpleCuboid as custom tag
        addTag(SimpleCuboid.class, c, rp);
        addTag(HexDimension.class, c, rp);
        addTag(UTF8CharDimension.class, c, rp);
View Full Code Here

        final String normalizedName = FilenameNormalizer.toFilename(tapeName);
        return fileResolver.toFile(normalizedName + ".yaml");
    }

    private Yaml getYaml() {
        Representer representer = new TapeRepresenter(fileResolver);
        representer.addClassTag(YamlTape.class, TAPE_TAG);

        Constructor constructor = new TapeConstructor(fileResolver);
        constructor.addTypeDescription(new TypeDescription(YamlTape.class, TAPE_TAG));

        DumperOptions dumperOptions = new DumperOptions();
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

        this.representer = representer;
        this.options = options;
    }

    public Dumper(DumperOptions options) {
        this(new Representer(), options);
    }
View Full Code Here

    public Dumper(Representer representer) {
        this(representer, new DumperOptions());
    }

    public Dumper() {
        this(new Representer(), new DumperOptions());
    }
View Full Code Here

    /**
     * Create Yaml instance. It is safe to create a few instances and use them
     * in different Threads.
     */
    public Yaml() {
        this(new Constructor(), new Representer(), new DumperOptions(), new Resolver());
    }
View Full Code Here

    /**
     * @deprecated
     */
    public Yaml(LoaderOptions loaderOptions) {
        this(new Constructor(), new Representer(), new DumperOptions(), new Resolver());
    }
View Full Code Here

     *
     * @param dumperOptions
     *            DumperOptions to configure outgoing objects
     */
    public Yaml(DumperOptions dumperOptions) {
        this(new Constructor(), new Representer(), dumperOptions);
    }
View Full Code Here

TOP

Related Classes of org.yaml.snakeyaml.representer.Representer

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.