Class Jackson

java.lang.Object
io.dropwizard.jackson.Jackson

public class Jackson extends Object
A utility class for Jackson.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.fasterxml.jackson.databind.ObjectMapper
    configure(com.fasterxml.jackson.databind.ObjectMapper mapper)
    Configures an ObjectMapper with the default set of common modules and properties.
    static com.fasterxml.jackson.databind.ObjectMapper
    Creates a new minimal ObjectMapper that will work with Dropwizard out of box.
    static com.fasterxml.jackson.databind.ObjectMapper
    Creates a new ObjectMapper with Guava and Logback support, as well as support for JsonSnakeCase.
    static com.fasterxml.jackson.databind.ObjectMapper
    newObjectMapper(@Nullable com.fasterxml.jackson.core.JsonFactory jsonFactory)
    Creates a new ObjectMapper with a custom JsonFactory with Guava and Logback support, as well as support for JsonSnakeCase.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • newObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper newObjectMapper()
      Creates a new ObjectMapper with Guava and Logback support, as well as support for JsonSnakeCase. Also includes all Discoverable interface implementations.
      Returns:
      the configured ObjectMapper
    • newObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper newObjectMapper(@Nullable com.fasterxml.jackson.core.JsonFactory jsonFactory)
      Creates a new ObjectMapper with a custom JsonFactory with Guava and Logback support, as well as support for JsonSnakeCase. Also includes all Discoverable interface implementations.
      Parameters:
      jsonFactory - instance of JsonFactory to use for the created ObjectMapper instance.
      Returns:
      the configured ObjectMapper
    • newMinimalObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper newMinimalObjectMapper()
      Creates a new minimal ObjectMapper that will work with Dropwizard out of box.

      NOTE: Use it, if the default Dropwizard's ObjectMapper, created in newObjectMapper(), 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 an ObjectMapper with the default set of common modules and properties.
      Parameters:
      mapper - the ObjectMapper to configure
      Returns:
      the configured ObjectMapper