gpt4 book ai didi

com.esotericsoftware.yamlbeans.YamlReader.getConfig()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 19:20:40 27 4
gpt4 key购买 nike

本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.getConfig()方法的一些代码示例,展示了YamlReader.getConfig()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlReader.getConfig()方法的具体详情如下:
包路径:com.esotericsoftware.yamlbeans.YamlReader
类名称:YamlReader
方法名:getConfig

YamlReader.getConfig介绍

暂无

代码示例

代码示例来源:origin: westnordost/StreetComplete

private CountryInfo loadCountryInfo(String countryCodeIso3166) throws IOException
{
  String filename = countryCodeIso3166+".yml";
  InputStream is = null;
  try
  {
    is = assetManager.open(BASEPATH + File.separator + filename);
    Reader reader =  new InputStreamReader(is, "UTF-8");
    YamlReader yamlReader = new YamlReader(reader);
    yamlReader.getConfig().setPrivateFields(true);
    CountryInfo result = yamlReader.read(CountryInfo.class);
    result.countryCode = countryCodeIso3166.split("-")[0];
    return result;
  }
  finally
  {
    if(is != null) try
    {
      is.close();
    }
    catch (IOException ignore) { }
  }
}

代码示例来源:origin: audit4j/audit4j-core

/**
 * {@inheritDoc}
 * 
 * @see org.audit4j.core.ConfigProvider#readConfig(java.io.InputStream)
 *
 */
@SuppressWarnings("unchecked")
@Override
public T readConfig(InputStream fileAsStream) throws ConfigurationException {
  InputStreamReader streamReader = new InputStreamReader(fileAsStream);
  try {
    YamlReader reader = new YamlReader(streamReader);
    reader.getConfig().setClassTag(clazz.getSimpleName(), clazz);
    return (T) reader.read();
  } catch (YamlException e) {
    throw new ConfigurationException("Configuration Exception", "CONF_002", e);
  }
}

代码示例来源:origin: audit4j/audit4j-core

/**
 * {@inheritDoc}
 * 
 * @see org.audit4j.core.ConfigProvider#readConfig(java.lang.String)
 * 
 */
@SuppressWarnings("unchecked")
@Override
public T readConfig(String filePath) throws ConfigurationException {
  try {
    YamlReader reader = new YamlReader(new FileReader(filePath));
    reader.getConfig().setClassTag(clazz.getSimpleName(), clazz);
    return (T) reader.read();
  } catch (FileNotFoundException e) {
    throw new ConfigurationException("Configuration Exception", "CONF_001", e);
  } catch (YamlException e) {
    throw new ConfigurationException("Configuration Exception", "CONF_002", e);
  }
}

代码示例来源:origin: stackoverflow.com

reader.getConfig().setClassTag("tag:yaml.org,2002:opencv-matrix", MatStorage.class);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com