- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.<init>()
方法的一些代码示例,展示了YamlReader.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlReader.<init>()
方法的具体详情如下:
包路径:com.esotericsoftware.yamlbeans.YamlReader
类名称:YamlReader
方法名:<init>
暂无
代码示例来源:origin: westnordost/StreetComplete
private List<Map.Entry<String,String>> readTranslators()
{
try
{
InputStream is = getResources().openRawResource(R.raw.credits_translations);
YamlReader reader = new YamlReader(new InputStreamReader(is));
Map yml = (Map) reader.read();
List<Map.Entry<String, String>> result = new ArrayList<>();
for (Object e : yml.entrySet())
{
result.add((Map.Entry<String, String>) e);
}
Collections.sort(result, (o1, o2) -> o1.getKey().compareTo(o2.getKey()));
return result;
} catch (YamlException e)
{
throw new RuntimeException(e);
}
}
}
代码示例来源:origin: westnordost/StreetComplete
private void parseConfig(InputStream config) throws YamlException
{
abbreviations = new HashMap<>();
YamlReader reader = new YamlReader(new InputStreamReader(config));
Map map = (Map) reader.read();
for(Object o : map.entrySet())
{
Map.Entry pair2 = (Map.Entry) o;
String abbreviation = ((String)pair2.getKey()).toLowerCase(locale);
String expansion = ((String) pair2.getValue()).toLowerCase(locale);
if(abbreviation.endsWith("$"))
{
abbreviation = abbreviation.substring(0, abbreviation.length() - 1) + "\\.?$";
}
else
{
abbreviation += "\\.?";
}
if(abbreviation.startsWith("..."))
{
abbreviation = "(\\w*)" + abbreviation.substring(3);
expansion = "$1" + expansion;
}
abbreviations.put(abbreviation, expansion);
}
}
代码示例来源:origin: westnordost/StreetComplete
private List<String> readContributors()
{
try
{
InputStream is = getResources().openRawResource(R.raw.credits_contributors);
YamlReader reader = new YamlReader(new InputStreamReader(is));
List<String> result = new ArrayList<>((List) reader.read());
result.add(getString(R.string.credits_and_more));
return result;
} catch (YamlException e)
{
throw new RuntimeException(e);
}
}
代码示例来源:origin: FlowCI/flow-platform
/**
* Yml To Map
* @param str
* @return
*/
public static Map ymlToMap(String str) {
Map result;
try {
YamlReader yamlReader = new YamlReader(str, yamlConfig);
result = (Map) yamlReader.read();
} catch (Throwable throwable) {
throw new YmlParseException(YML_ILLEGAL_MESSAGE);
}
return result;
}
代码示例来源: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: EsotericSoftware/yamlbeans
public static void main (String[] args) throws Exception {
YamlReader reader = new YamlReader(new FileReader("test/test.yml"));
System.out.println(reader.read());
}
}
代码示例来源:origin: com.esotericsoftware.yamlbeans/yamlbeans
public static void main (String[] args) throws Exception {
YamlReader reader = new YamlReader(new FileReader("test/test.yml"));
System.out.println(reader.read());
}
}
代码示例来源:origin: stackoverflow.com
YamlReader reader = new YamlReader(new FileReader("contact.yml"));
Object object = reader.read();
System.out.println(object);
Map map = (Map)object;
System.out.println(map.get("address"));
代码示例来源:origin: stackoverflow.com
name: Nathan Sweet
age: 28
public class Contact {
public String name;
public int age;
}
YamlReader reader = new YamlReader(new FileReader("contact.yml"));
Contact contact = reader.read(Contact.class);
System.out.println(contact.age);
代码示例来源:origin: stackoverflow.com
YamlReader reader = new YamlReader(new FileReader("contact.yml"));
Object object = reader.read();
System.out.println(object);
Map map = (Map)object;
System.out.println(map.get("address"));
代码示例来源:origin: com.github.havardh/javaflow
public TypeMap(String filename) {
try (FileReader fileReader = new FileReader(filename)) {
YamlReader yamlReader = new YamlReader(fileReader);
map = (Map<String, String>)yamlReader.read();
} catch (FileNotFoundException e) {
map = emptyMap();
} catch (IOException e) {
throw new ExitException(ErrorCode.COULD_NOT_PARSE_TYPE_MAP, e);
}
}
代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-lib
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);
}
}
代码示例来源:origin: com.sap.cloud.lm.sl/cloudfoundry-client-lib
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);
}
}
代码示例来源:origin: io.cloudslang.tools/cs-content-packager-sources
public String getGav() {
final YamlReader yamlReader = new YamlReader(new StringReader(slangSource.getContent()));
try {
final Optional<Object> gavOpt = simpleYPath(yamlReader.read(),
"operation.java_action.gav", ".");
final Object gav = gavOpt.orElseGet(() -> {
throw new RuntimeException("GAV not found in Slang file.");
});
return gav.toString();
} catch (YamlException e) {
throw new RuntimeException("Failed to parse the Slang file.");
}
}
}
代码示例来源:origin: io.cloudslang.tools/cs-content-packager-sources
public String getFullName() {
try {
final YamlReader yamlReader = new YamlReader(new StringReader(slangSource.getContent()));
final Optional<Object> namespace = simpleYPath(yamlReader.read(), "namespace", ".");
if (namespace.isPresent()) {
return format("%s.%s", namespace.get().toString(), getBaseName(slangSource.getName()));
}
} catch (YamlException exception) {
log.error("Failed to parse SL file.", exception);
}
return slangSource.getName();
}
代码示例来源:origin: io.cloudslang.tools/cs-content-packager-sources
public boolean isJavaOperation() {
final YamlReader yamlReader = new YamlReader(new StringReader(slangSource.getContent()));
try {
final Optional<Object> gavOpt = simpleYPath(yamlReader.read(),
"operation.java_action.gav", ".");
return gavOpt.isPresent();
} catch (YamlException e) {
return false;
}
}
代码示例来源:origin: mbechler/marshalsec
/**
* {@inheritDoc}
*
* @see marshalsec.MarshallerBase#unmarshal(java.lang.Object)
*/
@Override
public Object unmarshal ( String data ) throws Exception {
YamlConfig yc = new YamlConfig();
YamlReader r = new YamlReader(data, yc);
return r.read();
}
代码示例来源:origin: org.lorislab.hugoup/hugoup
public static <T> T readFile(String file, Class<T> clazz) throws Exception {
YamlConfig yamlConfig = new YamlConfig();
yamlConfig.readConfig.setClassTags(false);
YamlReader reader = new YamlReader(new FileReader(file));
return reader.read(clazz);
}
代码示例来源:origin: sonar-perl/sonar-perl
@SuppressWarnings("unchecked")
private void readMetaYaml(TestHarnessReport.TestHarnessReportBuilder builder, ArchiveInputStream archive) throws YamlException {
BufferedReader br = new BufferedReader(new InputStreamReader(archive));
YamlReader reader = new YamlReader(br);
Map<String, Object> object = (Map<String, Object>) reader.read(Map.class);
builder.startTime(getFromMap(object, "start_time"));
builder.endTime(getFromMap(object, "stop_time"));
for (Map<String, Object> fileAttr : (List<Map<String, Object>>) object.get("file_attributes")) {
builder.addTest(
new Test((String) fileAttr.get("description"), new BigDecimal((String) fileAttr.get("start_time")),
new BigDecimal((String) fileAttr.get("end_time"))));
}
}
代码示例来源:origin: tomzo/gocd-yaml-config-plugin
public static Object readYamlObject(String path) throws IOException {
YamlConfig config = new YamlConfig();
config.setAllowDuplicates(false);
YamlReader reader = new YamlReader(TestUtils.createReader(path), config);
return reader.read();
}
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.close()方法的一些代码示例,展示了YamlReader.close()的具体用法。这些代码
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.getConfig()方法的一些代码示例,展示了YamlReader.getConfig()的具
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.()方法的一些代码示例,展示了YamlReader.()的具体用法。这些代码示例主要来源于Git
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.read()方法的一些代码示例,展示了YamlReader.read()的具体用法。这些代码示例
本文整理了Java中io.konig.yaml.YamlReader.()方法的一些代码示例,展示了YamlReader.()的具体用法。这些代码示例主要来源于Github/Stackoverflow
本文整理了Java中org.milyn.yaml.YamlReader.initKeyMap()方法的一些代码示例,展示了YamlReader.initKeyMap()的具体用法。这些代码示例主要来源
本文整理了Java中io.konig.yaml.YamlReader.readObject()方法的一些代码示例,展示了YamlReader.readObject()的具体用法。这些代码示例主要来源于
本文整理了Java中pro.javatar.commons.reader.YamlReader.getInstance()方法的一些代码示例,展示了YamlReader.getInstance()的具
本文整理了Java中com.cognifide.qa.bb.utils.YamlReader.readFromTestResources()方法的一些代码示例,展示了YamlReader.readFr
本文整理了Java中info.magnolia.config.source.yaml.YamlReader.readNoCast()方法的一些代码示例,展示了YamlReader.readNoCast
本文整理了Java中info.magnolia.config.source.yaml.YamlReader.readWithDependencies()方法的一些代码示例,展示了YamlReader.
本文整理了Java中info.magnolia.config.source.yaml.YamlReader.read()方法的一些代码示例,展示了YamlReader.read()的具体用法。这些代码
本文整理了Java中info.magnolia.config.source.yaml.YamlReader.()方法的一些代码示例,展示了YamlReader.()的具体用法。这些代码示例主要来源于G
本文整理了Java中info.magnolia.config.source.yaml.YamlReader.registerCustomConstruct()方法的一些代码示例,展示了YamlRead
本文整理了Java中com.google.api.tools.framework.yaml.YamlReader.readYamlString()方法的一些代码示例,展示了YamlReader.rea
本文整理了Java中com.google.api.tools.framework.yaml.YamlReader.readConfig()方法的一些代码示例,展示了YamlReader.readCon
本文整理了Java中com.google.api.tools.framework.yaml.YamlReader.()方法的一些代码示例,展示了YamlReader.()的具体用法。这些代码示例主要来
本文整理了Java中org.pentaho.di.trans.steps.yamlinput.YamlReader.close()方法的一些代码示例,展示了YamlReader.close()的具体用
本文整理了Java中org.pentaho.di.trans.steps.yamlinput.YamlReader.()方法的一些代码示例,展示了YamlReader.()的具体用法。这些代码示例主要
本文整理了Java中org.pentaho.di.trans.steps.yamlinput.YamlReader.loadFile()方法的一些代码示例,展示了YamlReader.loadFile
我是一名优秀的程序员,十分优秀!