本文整理匯總了Java中org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory類的典型用法代碼示例。如果您正苦於以下問題:Java YAMLFactory類的具體用法?Java YAMLFactory怎麽用?Java YAMLFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
YAMLFactory類屬於org.nd4j.shade.jackson.dataformat.yaml包,在下文中一共展示了YAMLFactory類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testReadingYaml
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
@Test
public void testReadingYaml() throws Exception {
//Exact same information as JSON format, but in YAML format
ClassPathResource cpr = new ClassPathResource("yaml/yaml_test_0.txt");
String path = cpr.getFile().getAbsolutePath().replace("0", "%d");
InputSplit is = new NumberedFileInputSplit(path, 0, 2);
RecordReader rr = new JacksonRecordReader(getFieldSelection(), new ObjectMapper(new YAMLFactory()));
rr.initialize(is);
testJacksonRecordReader(rr);
}
示例2: initMapperYaml
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
private static ObjectMapper initMapperYaml() {
return initMapper(new YAMLFactory());
}
示例3: getMapper
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
private ObjectMapper getMapper() {
return getObjectMapper(new YAMLFactory());
}
示例4: initMapperYaml
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
private static ObjectMapper initMapperYaml() {
ObjectMapper ret = new ObjectMapper(new YAMLFactory());
configureMapper(ret);
return ret;
}
示例5: getYamlMapper
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
protected static synchronized ObjectMapper getYamlMapper() {
if (yamlMapper == null) {
yamlMapper = getNewMapper(new YAMLFactory());
}
return yamlMapper;
}
示例6: parseYamlString
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
/**
* Convenience function for parsing YAML strings.
*
* @param yaml String containing valid YAML
* @return Nested (key,value) map of arbitrary depth
* @throws IOException
*/
public static Map<String, Object> parseYamlString(String yaml) throws IOException {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {
};
return mapper.readValue(yaml, typeRef);
}
示例7: toYaml
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
/**
* Serialize this schema to yaml
* @return the yaml representation of this schema
*/
public String toYaml() {
return toJacksonString(new YAMLFactory());
}
示例8: fromYaml
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
/**
* Create a schema from the given
* yaml string
* @param yaml the yaml to create the schema from
* @return the created schema based on the yaml
*/
public static Schema fromYaml(String yaml) {
return fromJacksonString(yaml, new YAMLFactory());
}
示例9: findTypesFor
import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
/**
*
* @param types
* @param json
* @return
*/
public static ObjectMapper findTypesFor(List<Class<?>> types, boolean json) {
return withTypes(json ? new ObjectMapper() : new ObjectMapper(new YAMLFactory()), getImpls(types));
}