use of com.fasterxml.jackson.datatype.joda.JodaModule in project opsgenie-configuration-backup by opsgenie.
the class PolicyImporter method readJson.
private PolicyWithTeamInfo readJson(String policyJson) throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JodaModule());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
mapper.setDateFormat(sdf);
return mapper.readValue(policyJson, PolicyWithTeamInfo.class);
}
use of com.fasterxml.jackson.datatype.joda.JodaModule in project druidry by zapr-oss.
the class TimeSeriesTest method init.
@BeforeClass
public void init() {
objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.configure(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
}
use of com.fasterxml.jackson.datatype.joda.JodaModule in project syncope by apache.
the class SyncopeClientFactoryBean method defaultJsonProvider.
protected JacksonJaxbJsonProvider defaultJsonProvider() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JodaModule());
objectMapper.configure(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
return new JacksonJaxbJsonProvider(objectMapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);
}
use of com.fasterxml.jackson.datatype.joda.JodaModule in project tutorials by eugenp.
the class JacksonDateUnitTest method whenSerializingJodaTime_thenCorrect.
@Test
public void whenSerializingJodaTime_thenCorrect() throws JsonProcessingException {
final DateTime date = new DateTime(2014, 12, 20, 2, 30, DateTimeZone.forID("Europe/London"));
final ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JodaModule());
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
final String result = mapper.writeValueAsString(date);
assertThat(result, containsString("2014-12-20T02:30:00.000Z"));
}
use of com.fasterxml.jackson.datatype.joda.JodaModule in project modesti by jlsalmon.
the class RestConfig method configureJacksonObjectMapper.
@Override
public void configureJacksonObjectMapper(ObjectMapper objectMapper) {
SimpleModule module = new SimpleModule("CustomModule");
module.addAbstractTypeMapping(Point.class, PointImpl.class);
objectMapper.registerModule(module);
// Register a deserialiser for Joda classes
objectMapper.registerModule(new JodaModule());
}
Aggregations