本文整理汇总了Java中org.yaml.snakeyaml.Yaml.loadAll方法的典型用法代码示例。如果您正苦于以下问题:Java Yaml.loadAll方法的具体用法?Java Yaml.loadAll怎么用?Java Yaml.loadAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.yaml.snakeyaml.Yaml
的用法示例。
在下文中一共展示了Yaml.loadAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assertSupportedKinds
import org.yaml.snakeyaml.Yaml; //导入方法依赖的package包/类
private void assertSupportedKinds(String manifest) {
Yaml yaml = new Yaml();
Iterable<Object> object = yaml.loadAll(manifest);
for (Object o : object) {
assertSupportedKind(o);
}
}
开发者ID:spring-cloud,项目名称:spring-cloud-skipper,代码行数:8,代码来源:SpringCloudDeployerApplicationManifestReader.java
示例2: setupClass
import org.yaml.snakeyaml.Yaml; //导入方法依赖的package包/类
@Parameterized.Parameters
public static Collection<Object[]> setupClass() {
Constructor constructor = new Constructor(DataEntry.class);
TypeDescription description = new TypeDescription(DataEntry.class);
description.putListPropertyType("hash", String.class);
constructor.addTypeDescription(description);
Yaml yaml = new Yaml(constructor);
String[] fnames = new String[] {
// "data-50-columns-256-sponge-blake2b-rounds-12-blocks-12.yml"
// , "data-50-columns-256-sponge-blake2b-rounds-12-blocks-8.yml"
// , "data-50-columns-256-sponge-blake2b-rounds-1-blocks-12.yml"
// , "data-50-columns-256-sponge-blake2b-rounds-1-blocks-8.yml"
// , "data-50-columns-96-sponge-blamka-rounds-12-blocks-12.yml"
// , "data-50-columns-96-sponge-blamka-rounds-12-blocks-8.yml"
// , "data-50-columns-96-sponge-blamka-rounds-1-blocks-12.yml"
"data-50-columns-96-sponge-blamka-rounds-1-blocks-8.yml"
// , "data-50-columns-512-sponge-half-round-blamka-rounds-12-blocks-12.yml"
// , "data-50-columns-512-sponge-half-round-blamka-rounds-12-blocks-8.yml"
// , "data-50-columns-512-sponge-half-round-blamka-rounds-1-blocks-12.yml"
// , "data-50-columns-512-sponge-half-round-blamka-rounds-1-blocks-8.yml"
};
List<Object[]> entries = new ArrayList<>();
for (String fname: fnames) {
try {
ClassLoader loader = ClassLoader.getSystemClassLoader();
String s = loader.getResource(fname).getFile();
FileReader reader = new FileReader(s);
for (Object data : yaml.loadAll(reader)) {
entries.add(new Object[]{data});
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
return entries;
}