Search in sources :

Example 6 with YAMLFactory

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;
}
Also used : YAMLFactory(com.fasterxml.jackson.dataformat.yaml.YAMLFactory) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) SimpleModule(com.fasterxml.jackson.databind.module.SimpleModule)

Example 7 with YAMLFactory

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;
}
Also used : YAMLFactory(com.fasterxml.jackson.dataformat.yaml.YAMLFactory) File(java.io.File) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

YAMLFactory (com.fasterxml.jackson.dataformat.yaml.YAMLFactory)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)6 Profile (com.exalttech.trex.remote.models.profiles.Profile)1 JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)1 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)1 MediaContent (data.media.MediaContent)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 PatchClassInfo (org.mariotaku.patchlib.common.model.PatchClassInfo)1 ProcessingRules (org.mariotaku.patchlib.common.model.ProcessingRules)1 LibraryProcessor (org.mariotaku.patchlib.common.processor.LibraryProcessor)1