- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.read()
方法的一些代码示例,展示了YamlReader.read()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlReader.read()
方法的具体详情如下:
包路径:com.esotericsoftware.yamlbeans.YamlReader
类名称:YamlReader
方法名:read
[英]Reads the next YAML document and deserializes it into an object. The type of object is defined by the YAML tag. If there is no YAML tag, the object will be an ArrayList, HashMap, or String.
[中]读取下一个YAML文档并将其反序列化为对象。对象的类型由YAML标记定义。如果没有YAML标记,对象将是ArrayList、HashMap或字符串。
代码示例来源: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
/** Reads the next YAML document and deserializes it into an object. The type of object is defined by the YAML tag. If there is
* no YAML tag, the object will be an {@link ArrayList}, {@link HashMap}, or String. */
public Object read () throws YamlException {
return read(null);
}
代码示例来源:origin: EsotericSoftware/yamlbeans
/** Reads an object of the specified type from YAML.
* @param type The type of object to read. If null, behaves the same as {{@link #read()}. */
public <T> T read (Class<T> type) throws YamlException {
return read(type, null);
}
代码示例来源:origin: com.esotericsoftware.yamlbeans/yamlbeans
/** Reads the next YAML document and deserializes it into an object. The type of object is defined by the YAML tag. If there is
* no YAML tag, the object will be an {@link ArrayList}, {@link HashMap}, or String. */
public Object read () throws YamlException {
return read(null);
}
代码示例来源:origin: com.esotericsoftware.yamlbeans/yamlbeans
/** Reads an object of the specified type from YAML.
* @param type The type of object to read. If null, behaves the same as {{@link #read()}. */
public <T> T read (Class<T> type) throws YamlException {
return read(type, null);
}
代码示例来源: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: 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: 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: 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: 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: 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类的一些代码示例,展示了YamlReader类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.esotericsoftware.yamlbeans.YamlConfig类的一些代码示例,展示了YamlConfig类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter类的一些代码示例,展示了YamlWriter类的具体用法。这些代码示例主要来源于Github/St
本文整理了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中com.esotericsoftware.yamlbeans.YamlConfig.setAllowDuplicates()方法的一些代码示例,展示了YamlConfig.setA
本文整理了Java中com.esotericsoftware.yamlbeans.YamlConfig.()方法的一些代码示例,展示了YamlConfig.()的具体用法。这些代码示例主要来源于Git
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter.write()方法的一些代码示例,展示了YamlWriter.write()的具体用法。这些代码
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter.close()方法的一些代码示例,展示了YamlWriter.close()的具体用法。这些代码
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter.()方法的一些代码示例,展示了YamlWriter.()的具体用法。这些代码示例主要来源于Git
我正在尝试修复我的 IntelliJ,以便我可以再次成功构建我的项目。从团队的存储库重新调整代码后,我无法再找到必要的 kryonet 文件...一堆 .idea 文件被删除。 我尝试过以下方法: 添
我正在使用一个从 FLow 获取数据的服务。call() 的返回类型是 HashMap 。在调用 APi 时,我收到以下异常。我读到 HashMap 不包含在白名单中。任何人都可以建议如何从 cord
我需要在Storm中使用node-client编写一个 Elasticsearch bolt 。 我不想使用传输客户端,因为它效率较低(在节点之间增加一跳)。 因此,我尝试使用以下代码构建自己的ES
我在我的 flink 流作业中看到了一个奇怪的行为。这是我的代码 streamExecutionEnvironment.enableCheckpointing(checkPointIn
Tomcat Session Replication with Memcached。使用 kryo 序列化。启动tomcat时出现错误。 centos6.5 上的 Apache Tomcat/7.0.
我正在为我的 pojo 类使用 Flink 和自定义 kryo 类。但得到 Caused by: java.lang.NullPointerException at MyTreeSeriali
我有带 spark(1.6.1)、hdfs 和 hive(2.1) 的 yarn 集群。直到今天,我的工作流程在几个月内都运行良好(代码/环境没有任何变化)。我开始收到这样的错误: org.apach
我正在尝试在 Spark Streaming 中使用 Kryo Serializer。我读了 Spark tuning docs那- Finally, if you don’t register yo
我是一名优秀的程序员,十分优秀!