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
implementation that allows registration
of serializers and deserializers, and bean serializer
and deserializer modifiers.
invalid reference
Module
- Since:
- 1.7
-
Nested Class Summary
Nested classes/interfaces inherited from class org.codehaus.jackson.map.Module
Module.SetupContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SimpleAbstractTypeResolverLazily-constructed resolver used for storing mappings from abstract classes to more specific implementing classes (which may be abstract or concrete)protected SimpleDeserializersprotected SimpleKeyDeserializersprotected SimpleSerializersLazily-constructed map that contains mix-in definitions, indexed by target class, value being mix-in to apply.protected final Stringprotected SimpleSerializersprotected SimpleValueInstantiatorsLazily-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> SimpleModuleaddAbstractTypeMapping(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> SimpleModuleaddDeserializer(Class<T> type, JsonDeserializer<? extends T> deser) addKeyDeserializer(Class<?> type, KeyDeserializer deser) <T> SimpleModuleaddKeySerializer(Class<? extends T> type, JsonSerializer<T> ser) <T> SimpleModuleaddSerializer(Class<? extends T> type, JsonSerializer<T> ser) addSerializer(JsonSerializer<?> ser) addValueInstantiator(Class<?> beanType, ValueInstantiator inst) Method for registeringValueInstantiatorto 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.voidResets currently configured abstract type mappingsvoidResets all currently configured deserializers.voidResets all currently configured key deserializers.voidResets all currently configured key serializers.setMixInAnnotation(Class<?> targetType, Class<?> mixinClass) Method for specifying that annotations define bymixinClassshould be "mixed in" with annotations thattargetTypehas (as if they were directly included on it!).voidResets all currently configured serializers.voidsetupModule(Module.SetupContext context) Method called byObjectMapperwhen module is registered.voidResets 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 registeringValueInstantiatorto use when deserializing instances of typebeanType.Instantiator is registered when module is registered for
ObjectMapper. -
setMixInAnnotation
Method for specifying that annotations define bymixinClassshould be "mixed in" with annotations thattargetTypehas (as if they were directly included on it!).Mix-in annotations are registered when module is registered for
ObjectMapper. -
getModuleName
Description copied from class:ModuleMethod 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:
getModuleNamein classModule
-
setupModule
Description copied from class:ModuleMethod called byObjectMapperwhen module is registered. It is called to let module register functionality it provides, using callback methods passed-in context object exposes.- Specified by:
setupModulein classModule
-
version
Description copied from class:ModuleMethod that returns version of this module. Can be used by Jackson for informational purposes.
-