本文整理匯總了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;
}