Package org.codehaus.jackson.map.module
Class SimpleModule
java.lang.Object
org.codehaus.jackson.map.Module
org.codehaus.jackson.map.module.SimpleModule
- All Implemented Interfaces:
Versioned
Simple
Module
implementation that allows registration
of serializers and deserializers, and bean serializer
and deserializer modifiers.- Since:
- 1.7
-
Nested Class Summary
Nested classes/interfaces inherited from class org.codehaus.jackson.map.Module
Module.SetupContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SimpleAbstractTypeResolver
Lazily-constructed resolver used for storing mappings from abstract classes to more specific implementing classes (which may be abstract or concrete)protected SimpleDeserializers
protected SimpleKeyDeserializers
protected SimpleSerializers
Lazily-constructed map that contains mix-in definitions, indexed by target class, value being mix-in to apply.protected final String
protected SimpleSerializers
protected SimpleValueInstantiators
Lazily-constructed resolver used for storing mappings from abstract classes to more specific implementing classes (which may be abstract or concrete)protected final Version
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> SimpleModule
addAbstractTypeMapping
(Class<T> superType, Class<? extends T> subType) Lazily-constructed resolver used for storing mappings from abstract classes to more specific implementing classes (which may be abstract or concrete)<T> SimpleModule
addDeserializer
(Class<T> type, JsonDeserializer<? extends T> deser) addKeyDeserializer
(Class<?> type, KeyDeserializer deser) <T> SimpleModule
addKeySerializer
(Class<? extends T> type, JsonSerializer<T> ser) <T> SimpleModule
addSerializer
(Class<? extends T> type, JsonSerializer<T> ser) addSerializer
(JsonSerializer<?> ser) addValueInstantiator
(Class<?> beanType, ValueInstantiator inst) Method for registeringValueInstantiator
to use when deserializing instances of typebeanType
.Method that returns identifier for module; this can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.void
Resets currently configured abstract type mappingsvoid
Resets all currently configured deserializers.void
Resets all currently configured key deserializers.void
Resets all currently configured key serializers.setMixInAnnotation
(Class<?> targetType, Class<?> mixinClass) Method for specifying that annotations define bymixinClass
should be "mixed in" with annotations thattargetType
has (as if they were directly included on it!).void
Resets all currently configured serializers.void
setupModule
(Module.SetupContext context) Method called byObjectMapper
when module is registered.void
Resets all currently configured value instantiatorsversion()
Method that returns version of this module.
-
Field Details
-
_name
-
_version
-
_serializers
-
_deserializers
-
_keySerializers
-
_keyDeserializers
-
_abstractTypes
Lazily-constructed resolver used for storing mappings from abstract classes to more specific implementing classes (which may be abstract or concrete) -
_valueInstantiators
Lazily-constructed resolver used for storing mappings from abstract classes to more specific implementing classes (which may be abstract or concrete) -
_mixins
Lazily-constructed map that contains mix-in definitions, indexed by target class, value being mix-in to apply.- Since:
- 1.9
-
-
Constructor Details
-
SimpleModule
-
-
Method Details
-
setSerializers
Resets all currently configured serializers.- Since:
- 1.9
-
setDeserializers
Resets all currently configured deserializers.- Since:
- 1.9
-
setKeySerializers
Resets all currently configured key serializers.- Since:
- 1.9
-
setKeyDeserializers
Resets all currently configured key deserializers.- Since:
- 1.9
-
setAbstractTypes
Resets currently configured abstract type mappings- Since:
- 1.9
-
setValueInstantiators
Resets all currently configured value instantiators- Since:
- 1.9
-
addSerializer
-
addSerializer
-
addKeySerializer
-
addDeserializer
-
addKeyDeserializer
-
addAbstractTypeMapping
Lazily-constructed resolver used for storing mappings from abstract classes to more specific implementing classes (which may be abstract or concrete) -
addValueInstantiator
Method for registeringValueInstantiator
to use when deserializing instances of typebeanType
.Instantiator is registered when module is registered for
ObjectMapper
. -
setMixInAnnotation
Method for specifying that annotations define bymixinClass
should be "mixed in" with annotations thattargetType
has (as if they were directly included on it!).Mix-in annotations are registered when module is registered for
ObjectMapper
. -
getModuleName
Description copied from class:Module
Method that returns identifier for module; this can be used by Jackson for informational purposes, as well as in associating extensions with module that provides them.- Specified by:
getModuleName
in classModule
-
setupModule
Description copied from class:Module
Method called byObjectMapper
when module is registered. It is called to let module register functionality it provides, using callback methods passed-in context object exposes.- Specified by:
setupModule
in classModule
-
version
Description copied from class:Module
Method that returns version of this module. Can be used by Jackson for informational purposes.
-