Example usage for com.fasterxml.jackson.datatype.joda JodaModule addKeyDeserializer

List of usage examples for com.fasterxml.jackson.datatype.joda JodaModule addKeyDeserializer

Introduction

In this page you can find the example usage for com.fasterxml.jackson.datatype.joda JodaModule addKeyDeserializer.

Prototype

public SimpleModule addKeyDeserializer(Class<?> type, KeyDeserializer deser) 

Source Link

Usage

From source file:de.taimos.dvalin.interconnect.model.InterconnectMapper.java

private static ObjectMapper createMapper() {
    ObjectMapper mapper = new ObjectMapper();
    JodaModule jm = new JodaModule();
    // make some modifications to ensure correct tz serialization and get map keys working
    jm.addKeyDeserializer(DateTime.class, new DateTimeKeyDeserializer());
    jm.addDeserializer(DateTime.class, new DateTimeDeserializerWithTZ());
    mapper.registerModule(jm);/*  ww w  .  ja  va 2  s.  c  o m*/
    mapper.registerModule(new GuavaModule());
    mapper.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
    mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
    mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
    return mapper;
}