Package org.jdbi.v3.jackson2
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 Summary
Constructors Constructor Description Jackson2Config()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Jackson2ConfigcreateCopy()Class<?>getDeserializationView()com.fasterxml.jackson.databind.ObjectMappergetMapper()Class<?>getSerializationView()Jackson2ConfigsetDeserializationView(Class<?> deserializationView)Set the@JsonViewused to deserialize.Jackson2ConfigsetMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)Set theObjectMapperto use for json conversion.Jackson2ConfigsetSerializationView(Class<?> serializationView)Set the@JsonViewused to serialize.Jackson2ConfigsetView(Class<?> view)Set both serialization and deserialization@JsonViewto the given class.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jdbi.v3.core.config.JdbiConfig
setRegistry
-
-
-
-
Method Detail
-
setMapper
public Jackson2Config setMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Set theObjectMapperto 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
-
setView
public Jackson2Config setView(Class<?> view)
Set both serialization and deserialization@JsonViewto the given class.- Parameters:
view- the view class- Returns:
- this
-
setSerializationView
public Jackson2Config setSerializationView(Class<?> serializationView)
Set the@JsonViewused to serialize.- Parameters:
serializationView- the serialization view- Returns:
- this
-
getSerializationView
public Class<?> getSerializationView()
- Returns:
- the current
@JsonViewused for serialization
-
setDeserializationView
public Jackson2Config setDeserializationView(Class<?> deserializationView)
Set the@JsonViewused to deserialize.- Parameters:
deserializationView- the serialization view- Returns:
- this
-
getDeserializationView
public Class<?> getDeserializationView()
- Returns:
- the current
@JsonViewused for deserialization
-
createCopy
public Jackson2Config createCopy()
- Specified by:
createCopyin interfaceJdbiConfig<Jackson2Config>
-
-