Package com.esotericsoftware.yamlbeans

Examples of com.esotericsoftware.yamlbeans.YamlReader


  }

  protected TargetInfos getTokensFromFile() {
    final File tokensFile = getTokensFile();
    try {
      YamlReader reader = new YamlReader(new FileReader(tokensFile));
      return reader.read(TargetInfos.class);
    } catch (FileNotFoundException fnfe) {
      return new TargetInfos();
    } catch (IOException e) {
      throw new RuntimeException("An error occurred reading the tokens file at " +
          tokensFile.getPath() + ":" + e.getMessage(), e);
View Full Code Here


  private static <CF extends AbstractYamlConfFile> CF readConf(BRJSNode node, File confFile, Class<CF> confClass, String defaultFileCharacterEncoding) throws ConfigException
  {
    CF conf;
   
    try {
      YamlReader reader = null;
     
      try(Reader fileReader = new UnicodeReader(confFile, defaultFileCharacterEncoding)) {
        if(!fileReader.ready()) {
          return newConf(node, confClass);
        }
       
        reader = new YamlReader(fileReader);
        conf = reader.read(confClass);
        conf.initialize(node);
      }
      finally {
        if(reader != null) {
          reader.close();
        }
      }
    }
    catch(YamlReaderException e) {
      throw new ConfigException("Parse error while reading\n '" + confFile.getPath() + "':\n\n" +
View Full Code Here

    return !requestedFile.getName().contains("*");
  }

  private static Map<String, Object> getMapFromYamlConfig(File jsTestDriverConf) throws FileNotFoundException, YamlException, IOException
  {
    YamlReader reader = null;
    try {
      reader = new YamlReader(new FileReader(jsTestDriverConf));
      @SuppressWarnings("unchecked")
      Map<String, Object> configMap = (Map<String, Object>)reader.read();
      return configMap;
    }
    finally
    {
      if (reader != null)
      {
        reader.close();
      }
    }
  }
View Full Code Here

  private Map<String, Map<String, String>> browserPaths;
  private int portNumber;
  private String jsTestDriverJar;
 
  public static TestRunnerConfiguration getConfiguration(File configFile, List<String> browserNames) throws FileNotFoundException, YamlException, IOException {
    YamlReader reader = null;
    TestRunnerConfiguration configuration = null;
    try {
      reader = new YamlReader(new FileReader(configFile));
      configuration = reader.read(TestRunnerConfiguration.class);
    }
    finally
    {
      if (reader != null)
      {
        reader.close();
      }
    }
   
    configuration.setRelativeDir(configFile.getParentFile());
    configuration.setOperatingSystem(CutlassConfig.OS);
View Full Code Here

@IsoInformation(lastChangedBy = "$LastChangedBy: mc_new $", revision = "$LastChangedRevision: 248 $", source = "$URL: svn://svn.code.sf.net/p/isolation/code/Current/Source/Tags/dev_20101027/IsolationBean_Yaml/src/net/sf/isolation/bean/impl/yaml/yamlbeans/IsoBeanTextSerializerYamlImpl.java $", lastChangedDate = "$LastChangedDate: 2010-08-24 17:18:12 -0500 (Tue, 24 Aug 2010) $")
public class IsoBeanTextSerializerYamlImpl implements IsoBeanTextSerializer {

  public Object deserialize(String serialization, Class<?> spectedClass) {
    try {
      return new YamlReader(serialization).read();
    } catch (YamlException e) {
      throw new IllegalStateException();
    }
  }
View Full Code Here

       readYaml();
    }

    private static void readYaml() throws FileNotFoundException, YamlException {

        YamlReader yamlReader =
                new YamlReader(new FileReader("C:\\Users\\usta\\Dropbox\\AsciidocFX\\conf\\recentFiles.yml"));
        yamlReader.getConfig().setClassTag("RecentFiles", RecentFiles.class);
        RecentFiles readed=yamlReader.read(RecentFiles.class);
        readed=readed;
    }
View Full Code Here

        });
    }

    private void loadConfigurations() {
        try {
            YamlReader yamlReader =
                    new YamlReader(new FileReader(configPath.resolve("config.yml").toFile()));
            yamlReader.getConfig().setClassTag("Config", Config.class);
            config = yamlReader.read(Config.class);

        } catch (YamlException | FileNotFoundException e) {
            e.printStackTrace();
        }
View Full Code Here

    }

    private void loadRecentFileList() {

        try {
            YamlReader yamlReader =
                    new YamlReader(new FileReader(configPath.resolve("recentFiles.yml").toFile()));
            yamlReader.getConfig().setClassTag("RecentFiles", RecentFiles.class);
            RecentFiles readed = yamlReader.read(RecentFiles.class);

            readed.getFiles()
                    .stream()
                    .map(path -> Paths.get(path))
                    .forEach(recentFiles::add);
View Full Code Here

public class IsoBeanTextSerializerYamlImpl implements IsoBeanTextSerializer {

  @SuppressWarnings("unchecked")
  public <T> T deserialize(Class<T> spectedClass, String serialization) {
    try {
      return (T) new YamlReader(serialization).read();
    } catch (YamlException e) {
      throw new IllegalStateException();
    }
  }
View Full Code Here

TOP

Related Classes of com.esotericsoftware.yamlbeans.YamlReader

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.