Package org.yaml.snakeyaml

Examples of org.yaml.snakeyaml.Loader


        try
        {
            final Constructor constructor = new Constructor(CliUserHelp.class);
            TypeDescription desc = new TypeDescription(CliUserHelp.class);
            desc.putListPropertyType("commands", CliCommandHelp.class);
            final Yaml yaml = new Yaml(new Loader(constructor));
            return (CliUserHelp) yaml.load(is);
        }
        finally
        {
            FileUtils.closeQuietly(is);
View Full Code Here


            }
            org.yaml.snakeyaml.constructor.Constructor constructor = new org.yaml.snakeyaml.constructor.Constructor(Config.class);
            TypeDescription seedDesc = new TypeDescription(SeedProviderDef.class);
            seedDesc.putMapPropertyType("parameters", String.class, String.class);
            constructor.addTypeDescription(seedDesc);
            Yaml yaml = new Yaml(new Loader(constructor));
            conf = (Config)yaml.load(input);

            logger.info("Data files directories: " + Arrays.toString(conf.data_file_directories));
            logger.info("Commit log directory: " + conf.commitlog_directory);
View Full Code Here

        try
        {
            final Constructor constructor = new Constructor(NodeToolHelp.class);
            TypeDescription desc = new TypeDescription(NodeToolHelp.class);
            desc.putListPropertyType("commands", NodeToolHelp.NodeToolCommand.class);
            final Yaml yaml = new Yaml(new Loader(constructor));
            return (NodeToolHelp)yaml.load(is);
        }
        finally
        {
            FileUtils.closeQuietly(is);
View Full Code Here

        try
        {
            final Constructor constructor = new Constructor(CliUserHelp.class);
            TypeDescription desc = new TypeDescription(CliUserHelp.class);
            desc.putListPropertyType("commands", CliCommandHelp.class);
            final Yaml yaml = new Yaml(new Loader(constructor));
            return (CliUserHelp)yaml.load(is);
        }
        finally
        {
            try
View Full Code Here

        try
        {
            final Constructor constructor = new Constructor(NodeToolHelp.class);
            TypeDescription desc = new TypeDescription(NodeToolHelp.class);
            desc.putListPropertyType("commands", NodeToolHelp.NodeToolCommand.class);
            final Yaml yaml = new Yaml(new Loader(constructor));
            return (NodeToolHelp)yaml.load(is);
        }
        finally
        {
            FileUtils.closeQuietly(is);
View Full Code Here

      configDesc.putListPropertyType("nodes", YamlNode.class);
      constructor.addTypeDescription(configDesc);
      // note that snakeyaml also throws nosuchmethod error when you use the
      // non-deprecated
      // constructor
      Yaml yaml = new Yaml(new Loader(constructor));
      Config config;
      InputStream in = null;
      try {
         in = source.openStream();
         config = (Config) yaml.load(in);
View Full Code Here

      testDescription.putMapPropertyType("metaGroups", String.class, List.class);
      testDescription.putListPropertyType("method-selectors", XmlMethodSelector.class);
      constructor.addTypeDescription(testDescription);
    }

    Loader loader = new Loader(constructor);

    org.yaml.snakeyaml.Yaml y = new org.yaml.snakeyaml.Yaml(loader);
    if (is == null) is = new FileInputStream(new File(filePath));
    XmlSuite result = (XmlSuite) y.load(is);
View Full Code Here

      configDesc.putListPropertyType("nodes", YamlNode.class);
      constructor.addTypeDescription(configDesc);
      // note that snakeyaml also throws nosuchmethod error when you use the
      // non-deprecated
      // constructor
      Yaml yaml = new Yaml(new Loader(constructor));
      Config config;
      InputStream in = null;
      try {
         in = source.openStream();
         config = (Config) yaml.load(in);
View Full Code Here

    private final Yaml yaml;

    public YamlModelReader()
    {
        ModelConstructor constructor = new ModelConstructor();
        Loader loader = new Loader( constructor );
        yaml = new Yaml( loader );
    }
View Full Code Here

TOP

Related Classes of org.yaml.snakeyaml.Loader

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.