ObjectMapper
to provide a well-defined set of extensions to default functionality; such as
support for new data types.
Modifier and Type | Class and Description |
---|---|
public static interface | Module.
Interface Jackson exposes to modules for purpose of registering extended functionality. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public Iterable | |
public abstract String | getModuleName()
Method that returns a display that can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them. |
public Object | getTypeId()
Method that returns an id that may be used to determine if two |
public abstract void | |
public abstract Version | version()
Redeclares com. Method that returns version of this module. |
Module | back to summary |
---|---|
public Module() |
getDependencies | back to summary |
---|---|
public Iterable Returns the list of dependent modules this module has, if any. It is called to let modules register other modules as dependencies. Modules returned will be registered before this module is registered, in iteration order.
|
getModuleName | back to summary |
---|---|
public abstract String getModuleName() Method that returns a display that can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them. |
getTypeId | back to summary |
---|---|
public Object getTypeId() Method that returns an id that may be used to determine if two
Default implementation returns value of class name (
|
setupModule | back to summary |
---|---|
public abstract void setupModule(Module. Method called by |
version | back to summary |
---|---|
public abstract Version version() Redeclares com. Method that returns version of this module. Can be used by Jackson for informational purposes.
|
ObjectMapper
, but modules should
NOT rely on this -- if they do require access to mapper instance,
they need to call SetupContext#getOwner
method.
Modifier and Type | Method and Description |
---|---|
public void | addAbstractTypeResolver(AbstractTypeResolver
Resolver to add. resolver)Method that module can use to register additional
|
public void | addBeanDeserializerModifier(BeanDeserializerModifier
Modifier to register mod)Method that module can use to register additional modifier objects to customize configuration and construction of bean deserializers. |
public void | addBeanSerializerModifier(BeanSerializerModifier
Modifier to register mod)Method that module can use to register additional modifier objects to customize configuration and construction of bean serializers. |
public void | addDeserializationProblemHandler(DeserializationProblemHandler
The deserialization problem handler handler)Add a deserialization problem handler |
public void | addDeserializers(Deserializers
Object that can be called to find deserializer for types supported
by module (null returned for non-supported types) d)Method that module can use to register additional deserializers to use for handling types. |
public void | addKeyDeserializers(KeyDeserializers s)
Method that module can use to register additional deserializers to use for handling Map key values (which are separate from value deserializers because they are always serialized from String values) |
public void | addKeySerializers(Serializers s)
Method that module can use to register additional serializers to use for
handling Map key values (which are separate from value serializers because
they must write |
public void | addSerializers(Serializers
Object that can be called to find serializer for types supported
by module (null returned for non-supported types) s)Method that module can use to register additional serializers to use for handling types. |
public void | addTypeModifier(TypeModifier
to add modifier)Method that module can use to register additional
|
public void | addValueInstantiators(ValueInstantiators
Object that can provide instantiators)com. s for
constructing POJO values during deserializationMethod that module can use to register additional |
public void | appendAnnotationIntrospector(AnnotationIntrospector
Annotation introspector to register. ai)Method for registering specified |
public MutableConfigOverride | configOverride(Class<?> type)
"Mutant accessor" for getting a mutable configuration override object for given type, needed to add or change per-type overrides applied to properties of given type. |
public Version | getMapperVersion()
Method that returns version information about |
public <C extends ObjectCodec> C | getOwner()
Fallback access method that allows modules to refer to the
|
public TypeFactory | |
public void | insertAnnotationIntrospector(AnnotationIntrospector
Annotation introspector to register. ai)Method for registering specified |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public void | registerSubtypes(Class<?>... subtypes)
Method for registering specified classes as subtypes (of supertype(s) they have) |
public void | registerSubtypes(NamedType... subtypes)
Method for registering specified classes as subtypes (of supertype(s) they have), using specified type names. |
public void | registerSubtypes(Collection<Class<?>> subtypes)
Method for registering specified classes as subtypes (of supertype(s) they have) |
public void | setClassIntrospector(ClassIntrospector
Derived class of ClassIntrospector with overriden behavior ci)Method for replacing the default class introspector with a derived class that overrides specific behavior. |
public void | setMixInAnnotations(Class<?>
Class (or interface) whose annotations to effectively override target, Class<?> Class (or interface) whose annotations are to
be "added" to target's annotations, overriding as necessary mixinSource)Method used for defining mix-in annotations to use for augmenting specified class or interface. |
public void | setNamingStrategy(PropertyNamingStrategy naming)
Method that may be used to override naming strategy that is used
by |
addAbstractTypeResolver | back to summary |
---|---|
public void addAbstractTypeResolver(AbstractTypeResolver resolver) Method that module can use to register additional
|
addBeanDeserializerModifier | back to summary |
---|---|
public void addBeanDeserializerModifier(BeanDeserializerModifier mod) Method that module can use to register additional modifier objects to customize configuration and construction of bean deserializers.
|
addBeanSerializerModifier | back to summary |
---|---|
public void addBeanSerializerModifier(BeanSerializerModifier mod) Method that module can use to register additional modifier objects to customize configuration and construction of bean serializers.
|
addDeserializationProblemHandler | back to summary |
---|---|
public void addDeserializationProblemHandler(DeserializationProblemHandler handler) Add a deserialization problem handler
|
addDeserializers | back to summary |
---|---|
public void addDeserializers(Deserializers d) Method that module can use to register additional deserializers to use for handling types.
|
addKeyDeserializers | back to summary |
---|---|
public void addKeyDeserializers(KeyDeserializers s) Method that module can use to register additional deserializers to use for handling Map key values (which are separate from value deserializers because they are always serialized from String values) |
addKeySerializers | back to summary |
---|---|
public void addKeySerializers(Serializers s) Method that module can use to register additional serializers to use for
handling Map key values (which are separate from value serializers because
they must write |
addSerializers | back to summary |
---|---|
public void addSerializers(Serializers s) Method that module can use to register additional serializers to use for handling types.
|
addTypeModifier | back to summary |
---|---|
public void addTypeModifier(TypeModifier modifier) Method that module can use to register additional
|
addValueInstantiators | back to summary |
---|---|
public void addValueInstantiators(ValueInstantiators instantiators) Method that module can use to register additional
|
appendAnnotationIntrospector | back to summary |
---|---|
public void appendAnnotationIntrospector(AnnotationIntrospector ai) Method for registering specified
|
configOverride | back to summary |
---|---|
public MutableConfigOverride configOverride(Class<?> type) "Mutant accessor" for getting a mutable configuration override object for given type, needed to add or change per-type overrides applied to properties of given type. Usage is through returned object by colling "setter" methods, which directly modify override object and take effect directly. For example you can do mapper.configOverride(java.util.Date.class) .setFormat(JsonFormat.Value.forPattern("yyyy-MM-dd"));to change the default format to use for properties of type java. (possibly further overridden by per-property
annotations)
|
getMapperVersion | back to summary |
---|---|
public Version getMapperVersion() Method that returns version information about |
getOwner | back to summary |
---|---|
public <C extends ObjectCodec> C getOwner() Fallback access method that allows modules to refer to the
Note use of this method is discouraged, as it allows access to things Modules typically should not modify. It is included, however, to allow access to new features in cases where Module API has not yet been extended, or there are oversights.
Return value is chosen to not leak dependency to
|
getTypeFactory | back to summary |
---|---|
public TypeFactory getTypeFactory() Accessor for finding Note since it is possible that other modules might change or replace TypeFactory, use of this method adds order-dependency for registrations.
|
insertAnnotationIntrospector | back to summary |
---|---|
public void insertAnnotationIntrospector(AnnotationIntrospector ai) Method for registering specified
|
isEnabled | back to summary |
---|---|
public boolean isEnabled(MapperFeature f) |
isEnabled | back to summary |
---|---|
public boolean isEnabled(DeserializationFeature f) |
isEnabled | back to summary |
---|---|
public boolean isEnabled(SerializationFeature f) |
isEnabled | back to summary |
---|---|
public boolean isEnabled(JsonFactory. |
isEnabled | back to summary |
---|---|
public boolean isEnabled(JsonParser. |
isEnabled | back to summary |
---|---|
public boolean isEnabled(JsonGenerator. |
registerSubtypes | back to summary |
---|---|
public void registerSubtypes(Class<?>... subtypes) Method for registering specified classes as subtypes (of supertype(s) they have) |
registerSubtypes | back to summary |
---|---|
public void registerSubtypes(NamedType... subtypes) Method for registering specified classes as subtypes (of supertype(s) they have), using specified type names. |
registerSubtypes | back to summary |
---|---|
public void registerSubtypes(Collection<Class<?>> subtypes) Method for registering specified classes as subtypes (of supertype(s) they have)
|
setClassIntrospector | back to summary |
---|---|
public void setClassIntrospector(ClassIntrospector ci) Method for replacing the default class introspector with a derived class that overrides specific behavior.
|
setMixInAnnotations | back to summary |
---|---|
public void setMixInAnnotations(Class<?> target, Class<?> mixinSource) Method used for defining mix-in annotations to use for augmenting
specified class or interface.
All annotations from
Note mix-ins are registered both for serialization and deserialization (which can be different internally). Note currently only one set of mix-in annotations can be defined for a single class; so if multiple modules register mix-ins, highest priority one (last one registered) will have priority over other modules. |
setNamingStrategy | back to summary |
---|---|
public void setNamingStrategy(PropertyNamingStrategy naming) Method that may be used to override naming strategy that is used
by
|