Add and register Jackson Joda-Time module

This commit is contained in:
Chris Birchall 2014-01-26 11:31:08 +09:00
parent 6b9cba1411
commit b7cffe4121
2 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,7 @@ public class JsonUtil {
mapper = new ObjectMapper(); mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
mapper.registerModule(new JodaModule());
} }
public static ObjectMapper getJsonMapper() { public static ObjectMapper getJsonMapper() {

View File

@ -178,6 +178,11 @@
<version>${jackson-version}</version> <version>${jackson-version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>