Package io.dropwizard.jackson
Class Jackson
java.lang.Object
io.dropwizard.jackson.Jackson
A utility class for Jackson.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.ObjectMapperconfigure(com.fasterxml.jackson.databind.ObjectMapper mapper) Configures anObjectMapperwith the default set of common modules and properties.static com.fasterxml.jackson.databind.ObjectMapperCreates a new minimalObjectMapperthat will work with Dropwizard out of box.static com.fasterxml.jackson.databind.ObjectMapperCreates a newObjectMapperwith Guava and Logback support, as well as support forJsonSnakeCase.static com.fasterxml.jackson.databind.ObjectMappernewObjectMapper(@Nullable com.fasterxml.jackson.core.JsonFactory jsonFactory) Creates a newObjectMapperwith a customJsonFactorywith Guava and Logback support, as well as support forJsonSnakeCase.
-
Method Details
-
newObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper newObjectMapper()Creates a newObjectMapperwith Guava and Logback support, as well as support forJsonSnakeCase. Also includes allDiscoverableinterface implementations.- Returns:
- the configured
ObjectMapper
-
newObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper newObjectMapper(@Nullable com.fasterxml.jackson.core.JsonFactory jsonFactory) Creates a newObjectMapperwith a customJsonFactorywith Guava and Logback support, as well as support forJsonSnakeCase. Also includes allDiscoverableinterface implementations.- Parameters:
jsonFactory- instance ofJsonFactoryto use for the createdObjectMapperinstance.- Returns:
- the configured
ObjectMapper
-
newMinimalObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper newMinimalObjectMapper()Creates a new minimalObjectMapperthat will work with Dropwizard out of box.NOTE: Use it, if the default Dropwizard's
ObjectMapper, created innewObjectMapper(), is too aggressive for you.- Returns:
- the configured
ObjectMapper
-
configure
public static com.fasterxml.jackson.databind.ObjectMapper configure(com.fasterxml.jackson.databind.ObjectMapper mapper) Configures anObjectMapperwith the default set of common modules and properties.- Parameters:
mapper- theObjectMapperto configure- Returns:
- the configured
ObjectMapper
-