Interface Module.SetupContext
- Enclosing class:
Module
public static interface Module.SetupContext
Interface Jackson exposes to modules for purpose of registering
extended functionality.
- Since:
- 1.7
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAbstractTypeResolver(AbstractTypeResolver resolver) Method that module can use to register additionalAbstractTypeResolverinstance, to handle resolution of abstract to concrete types (either by defaulting, or by materializing).voidMethod that module can use to register additional modifier objects to customize configuration and construction of bean deserializers.voidMethod that module can use to register additional modifier objects to customize configuration and construction of bean serializers.voidMethod that module can use to register additional deserializers to use for handling types.voidMethod 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)voidMethod that module can use to register additional serializers to use for handling Map key values (which are separate from value serializers because they must writeJsonToken.FIELD_NAMEinstead of String value).voidMethod that module can use to register additional serializers to use for handling types.voidaddTypeModifier(TypeModifier modifier) Method that module can use to register additionalTypeModifierinstance, which can augmentJavaTypeinstances constructed byTypeFactory.voidaddValueInstantiators(ValueInstantiators instantiators) Method that module can use to register additionalValueInstantiators, by addingValueInstantiatorsobject that gets called when instantatiator is needed by a deserializer.voidMethod for registering specifiedAnnotationIntrospectoras the lowest priority introspector, chained with existing introspector(s) and called as fallback for cases not otherwise handled.Method that returns current deserialization configuration settings.Method that returns version information aboutObjectMapperthat implements this context.Method that returns current serialization configuration settings.voidMethod for registering specifiedAnnotationIntrospectoras the highest priority introspector (will be chained with existing introspector(s) which will be used as fallbacks for cases this introspector does not handle)booleanbooleanbooleanbooleanvoidsetMixInAnnotations(Class<?> target, Class<?> mixinSource) Method used for defining mix-in annotations to use for augmenting specified class or interface.
-
Method Details
-
getMapperVersion
Version getMapperVersion()Method that returns version information aboutObjectMapperthat implements this context. Modules can use this to choose different settings or initialization order; or even decide to fail set up completely if version is compatible with module. -
getDeserializationConfig
DeserializationConfig getDeserializationConfig()Method that returns current deserialization configuration settings. Since modules may be interested in these settings, caller should make sure to make changes to settings before module registrations. -
getSerializationConfig
SerializationConfig getSerializationConfig()Method that returns current serialization configuration settings. Since modules may be interested in these settings, caller should make sure to make changes to settings before module registrations.- Since:
- 1.7.1 (1.7.0 unfortunately had a typo in method name!)
-
isEnabled
- Since:
- 1.9.0
-
isEnabled
- Since:
- 1.9.0
-
isEnabled
- Since:
- 1.9.0
-
isEnabled
- Since:
- 1.9.0
-
addDeserializers
Method that module can use to register additional deserializers to use for handling types.- Parameters:
d- Object that can be called to find deserializer for types supported by module (null returned for non-supported types)
-
addKeyDeserializers
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)- Since:
- 1.8
-
addSerializers
Method that module can use to register additional serializers to use for handling types.- Parameters:
s- Object that can be called to find serializer for types supported by module (null returned for non-supported types)
-
addKeySerializers
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 writeJsonToken.FIELD_NAMEinstead of String value).- Since:
- 1.8
-
addBeanDeserializerModifier
Method that module can use to register additional modifier objects to customize configuration and construction of bean deserializers.- Parameters:
mod- Modifier to register
-
addBeanSerializerModifier
Method that module can use to register additional modifier objects to customize configuration and construction of bean serializers.- Parameters:
mod- Modifier to register
-
addAbstractTypeResolver
Method that module can use to register additionalAbstractTypeResolverinstance, to handle resolution of abstract to concrete types (either by defaulting, or by materializing).- Parameters:
resolver- Resolver to add.- Since:
- 1.8
-
addTypeModifier
Method that module can use to register additionalTypeModifierinstance, which can augmentJavaTypeinstances constructed byTypeFactory.- Parameters:
modifier- to add- Since:
- 1.8
-
addValueInstantiators
Method that module can use to register additionalValueInstantiators, by addingValueInstantiatorsobject that gets called when instantatiator is needed by a deserializer.- Parameters:
instantiators- Object that can provideValueInstantiators for constructing POJO values during deserialization- Since:
- 1.9
-
insertAnnotationIntrospector
Method for registering specifiedAnnotationIntrospectoras the highest priority introspector (will be chained with existing introspector(s) which will be used as fallbacks for cases this introspector does not handle)- Parameters:
ai- Annotation introspector to register.
-
appendAnnotationIntrospector
Method for registering specifiedAnnotationIntrospectoras the lowest priority introspector, chained with existing introspector(s) and called as fallback for cases not otherwise handled.- Parameters:
ai- Annotation introspector to register.
-
setMixInAnnotations
Method used for defining mix-in annotations to use for augmenting specified class or interface. All annotations frommixinSourceare taken to override annotations thattarget(or its supertypes) has.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.
- Parameters:
target- Class (or interface) whose annotations to effectively overridemixinSource- Class (or interface) whose annotations are to be "added" to target's annotations, overriding as necessary
-