Class Jackson2Config

java.lang.Object
org.jdbi.v3.jackson2.Jackson2Config
All Implemented Interfaces:
JdbiConfig<Jackson2Config>

public class Jackson2Config extends Object implements JdbiConfig<Jackson2Config>
Configuration class for Jackson 2 integration.
  • Constructor Details

    • Jackson2Config

      public Jackson2Config()
  • Method Details

    • setMapper

      public Jackson2Config setMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
      Set the ObjectMapper to use for json conversion.
      Parameters:
      mapper - the mapper to use
      Returns:
      this
    • getMapper

      public com.fasterxml.jackson.databind.ObjectMapper getMapper()
      Returns the object mapper to use for json conversion.
      Returns:
      the object mapper to use for json conversion.
    • setView

      public Jackson2Config setView(Class<?> view)
      Set both serialization and deserialization @JsonView to the given class.
      Parameters:
      view - the view class
      Returns:
      this
    • setSerializationView

      public Jackson2Config setSerializationView(Class<?> serializationView)
      Set the @JsonView used to serialize.
      Parameters:
      serializationView - the serialization view
      Returns:
      this
    • getSerializationView

      public Class<?> getSerializationView()
      Returns the current @JsonView used for serialization.
      Returns:
      The current @JsonView used for serialization.
    • setDeserializationView

      public Jackson2Config setDeserializationView(Class<?> deserializationView)
      Set the @JsonView used to deserialize.
      Parameters:
      deserializationView - the serialization view
      Returns:
      this
    • getDeserializationView

      public Class<?> getDeserializationView()
      Returns the current @JsonView used for deserialization.
      Returns:
      the current @JsonView used for deserialization.
    • createCopy

      public Jackson2Config createCopy()
      Description copied from interface: JdbiConfig
      Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.
      Specified by:
      createCopy in interface JdbiConfig<Jackson2Config>
      Returns:
      a copy of this configuration object.