本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.getConfig()
方法的一些代码示例,展示了YamlReader.getConfig()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlReader.getConfig()
方法的具体详情如下:
包路径:com.esotericsoftware.yamlbeans.YamlReader
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!