Search in sources :

Example 1 with GuavaModule

use of com.fasterxml.jackson.datatype.guava.GuavaModule in project dropwizard by dropwizard.

the class GuavaExtrasModuleTest method setUp.

@Before
public void setUp() throws Exception {
    mapper.registerModule(new GuavaModule());
    mapper.registerModule(new GuavaExtrasModule());
}
Also used : GuavaModule(com.fasterxml.jackson.datatype.guava.GuavaModule) Before(org.junit.Before)

Example 2 with GuavaModule

use of com.fasterxml.jackson.datatype.guava.GuavaModule in project ratpack by ratpack.

the class DefaultConfigDataBuilder method newDefaultObjectMapper.

public static ObjectMapper newDefaultObjectMapper() {
    ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
    objectMapper.registerModule(new Jdk8Module());
    objectMapper.registerModule(new GuavaModule());
    objectMapper.registerModule(new JavaTimeModule());
    JsonFactory factory = objectMapper.getFactory();
    factory.enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES);
    factory.enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);
    return objectMapper;
}
Also used : Jdk8Module(com.fasterxml.jackson.datatype.jdk8.Jdk8Module) JavaTimeModule(com.fasterxml.jackson.datatype.jsr310.JavaTimeModule) JsonFactory(com.fasterxml.jackson.core.JsonFactory) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) GuavaModule(com.fasterxml.jackson.datatype.guava.GuavaModule)

Example 3 with GuavaModule

use of com.fasterxml.jackson.datatype.guava.GuavaModule in project ds3_autogen by SpectraLogic.

the class Ds3NameMapperParserImpl method initDs3NameMapper.

private static ObjectMapper initDs3NameMapper() {
    final ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.registerModule(new GuavaModule());
    return objectMapper;
}
Also used : ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) GuavaModule(com.fasterxml.jackson.datatype.guava.GuavaModule)

Example 4 with GuavaModule

use of com.fasterxml.jackson.datatype.guava.GuavaModule in project dropwizard by dropwizard.

the class Jackson method configure.

private static ObjectMapper configure(ObjectMapper mapper) {
    mapper.registerModule(new GuavaModule());
    mapper.registerModule(new LogbackModule());
    mapper.registerModule(new GuavaExtrasModule());
    mapper.registerModule(new JodaModule());
    mapper.registerModule(new AfterburnerModule());
    mapper.registerModule(new FuzzyEnumModule());
    mapper.registerModule(new ParameterNamesModule());
    mapper.registerModules(new Jdk8Module());
    mapper.registerModules(new JavaTimeModule());
    mapper.setPropertyNamingStrategy(new AnnotationSensitivePropertyNamingStrategy());
    mapper.setSubtypeResolver(new DiscoverableSubtypeResolver());
    return mapper;
}
Also used : AfterburnerModule(com.fasterxml.jackson.module.afterburner.AfterburnerModule) Jdk8Module(com.fasterxml.jackson.datatype.jdk8.Jdk8Module) ParameterNamesModule(com.fasterxml.jackson.module.paramnames.ParameterNamesModule) JodaModule(com.fasterxml.jackson.datatype.joda.JodaModule) JavaTimeModule(com.fasterxml.jackson.datatype.jsr310.JavaTimeModule) GuavaModule(com.fasterxml.jackson.datatype.guava.GuavaModule)

Example 5 with GuavaModule

use of com.fasterxml.jackson.datatype.guava.GuavaModule in project buck by facebook.

the class ObjectMappers method newDefaultInstance.

public static ObjectMapper newDefaultInstance() {
    ObjectMapper mapper = new ObjectMapper();
    // Disable automatic flush() after mapper.write() call, because it is usually unnecessary,
    // and it makes BufferedOutputStreams to be useless
    mapper.disable(SerializationFeature.FLUSH_AFTER_WRITE_VALUE);
    // Add support for serializing Guava collections.
    mapper.registerModule(new GuavaModule());
    mapper.registerModule(new Jdk8Module());
    return mapper;
}
Also used : Jdk8Module(com.fasterxml.jackson.datatype.jdk8.Jdk8Module) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) GuavaModule(com.fasterxml.jackson.datatype.guava.GuavaModule)

Aggregations

GuavaModule (com.fasterxml.jackson.datatype.guava.GuavaModule)10 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)8 Jdk8Module (com.fasterxml.jackson.datatype.jdk8.Jdk8Module)4 JsonFactory (com.fasterxml.jackson.core.JsonFactory)2 JavaTimeModule (com.fasterxml.jackson.datatype.jsr310.JavaTimeModule)2 JodaModule (com.fasterxml.jackson.datatype.joda.JodaModule)1 JacksonJaxbJsonProvider (com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider)1 AfterburnerModule (com.fasterxml.jackson.module.afterburner.AfterburnerModule)1 MrBeanModule (com.fasterxml.jackson.module.mrbean.MrBeanModule)1 ParameterNamesModule (com.fasterxml.jackson.module.paramnames.ParameterNamesModule)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)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 ExternalDc (io.mesosphere.mesos.frameworks.cassandra.CassandraFrameworkProtos.ExternalDc)1 HealthReportService (io.mesosphere.mesos.frameworks.cassandra.scheduler.health.HealthReportService)1 Clock (io.mesosphere.mesos.util.Clock)1 SystemClock (io.mesosphere.mesos.util.SystemClock)1