use of com.fasterxml.jackson.datatype.jdk8.Jdk8Module in project syndesis-qe by syndesisio.
the class RestUtils method createJacksonProvider.
private static ResteasyJackson2Provider createJacksonProvider(Optional<SerializationFeature> serialization, Optional<DeserializationFeature> deserialization) {
final ResteasyJackson2Provider jackson2Provider = new ResteasyJackson2Provider();
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new Jdk8Module());
if (serialization.isPresent()) {
objectMapper.enable(serialization.get());
}
if (deserialization.isPresent()) {
objectMapper.enable(deserialization.get());
}
jackson2Provider.setMapper(objectMapper);
return jackson2Provider;
}
Aggregations