Example usage for com.fasterxml.jackson.databind ObjectMapper ObjectMapper

List of usage examples for com.fasterxml.jackson.databind ObjectMapper ObjectMapper

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind ObjectMapper ObjectMapper.

Prototype

protected ObjectMapper(ObjectMapper src) 

Source Link

Document

Copy-constructor, mostly used to support #copy .

Usage

From source file:com.chiralBehaviors.slp.hive.configuration.BroadcastConfiguration.java

public static BroadcastConfiguration fromYaml(InputStream yaml)
        throws JsonParseException, JsonMappingException, IOException {
    ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    mapper.registerModule(new EngineModule());
    return mapper.readValue(yaml, BroadcastConfiguration.class);
}

From source file:com.wso2telco.core.pcrservice.util.YamlReader.java

/**
 * Gets the configuration.// w  ww.  j  a  va  2 s.  co m
 *
 * @return the configuration
 */
public static ConfigDTO getConfiguration() {

    File file = new File(DEVICE_MGT_CONFIG_PATH);
    ConfigDTO configPojo = new ConfigDTO();

    final ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); // jackson databind

    try {
        configPojo = mapper.readValue(file, ConfigDTO.class);
    } catch (JsonParseException e) {
        log.error("Yaml Parsing Error", e);
    } catch (JsonMappingException e) {
        log.error("Yaml Mapping Error", e);
    } catch (IOException e) {
        log.error("Yaml File Error", e);
    }

    return configPojo;
}

From source file:com.chiralBehaviors.groo.configuration.ChakaalConfiguration.java

public static ChakaalConfiguration fromYaml(InputStream yaml)
        throws JsonParseException, JsonMappingException, IOException {
    ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    mapper.registerModule(new DiscoveryModule());
    return mapper.readValue(yaml, ChakaalConfiguration.class);
}

From source file:org.redisson.codec.CborJacksonCodec.java

public CborJacksonCodec(ClassLoader classLoader) {
    super(createObjectMapper(classLoader, new ObjectMapper(new CBORFactory())));
}

From source file:org.redisson.codec.AvroJacksonCodec.java

public AvroJacksonCodec(ClassLoader classLoader) {
    super(createObjectMapper(classLoader, new ObjectMapper(new AvroFactory())));
}

From source file:org.redisson.codec.SmileJacksonCodec.java

public SmileJacksonCodec(ClassLoader classLoader) {
    super(createObjectMapper(classLoader, new ObjectMapper(new SmileFactory())));
}