Search in sources :

Example 11 with Jdk8Module

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;
}
Also used : ResteasyJackson2Provider(org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider) Jdk8Module(com.fasterxml.jackson.datatype.jdk8.Jdk8Module) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

Jdk8Module (com.fasterxml.jackson.datatype.jdk8.Jdk8Module)11 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)9 JavaTimeModule (com.fasterxml.jackson.datatype.jsr310.JavaTimeModule)5 GuavaModule (com.fasterxml.jackson.datatype.guava.GuavaModule)4 IOException (java.io.IOException)3 ParameterNamesModule (com.fasterxml.jackson.module.paramnames.ParameterNamesModule)2 Action (io.syndesis.common.model.action.Action)2 JSONObject (org.json.JSONObject)2 JsonFactory (com.fasterxml.jackson.core.JsonFactory)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)1 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)1 JodaModule (com.fasterxml.jackson.datatype.joda.JodaModule)1 AfterburnerModule (com.fasterxml.jackson.module.afterburner.AfterburnerModule)1 Provides (com.google.inject.Provides)1 AnnotationSensitivePropertyNamingStrategy (io.dropwizard.jackson.AnnotationSensitivePropertyNamingStrategy)1 DiscoverableSubtypeResolver (io.dropwizard.jackson.DiscoverableSubtypeResolver)1 FuzzyEnumModule (io.dropwizard.jackson.FuzzyEnumModule)1 GuavaExtrasModule (io.dropwizard.jackson.GuavaExtrasModule)1 LogbackModule (io.dropwizard.jackson.LogbackModule)1