use of com.fasterxml.jackson.dataformat.yaml.YAMLFactory in project KaiZen-OpenAPI-Editor by RepreZen.
the class Model method createMapper.
protected static ObjectMapper createMapper() {
final ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
final SimpleModule module = new SimpleModule();
module.addDeserializer(AbstractNode.class, new NodeDeserializer());
mapper.registerModule(module);
return mapper;
}
use of com.fasterxml.jackson.dataformat.yaml.YAMLFactory in project trex-stateless-gui by cisco-system-traffic-generator.
the class TrafficProfile method convertTrafficProfileToYamlFile.
/**
* @param trafficProfileArray
* @param fileName
*
* @return Converts Traffic Profile to Yaml String
* @throws JsonProcessingException
*
*/
public File convertTrafficProfileToYamlFile(Profile[] trafficProfileArray, String fileName) throws IOException {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
String localFileName = FileManager.getProfilesFilePath() + fileName;
File yamlFile = new File(localFileName);
mapper.writeValue(yamlFile, trafficProfileArray);
return yamlFile;
}
Aggregations