Top Description Fields Constructors Methods
tools.jackson.databind.cfg

public Class ModuleContextBase

extends Object
implements SetupContext
Class Inheritance
All Implemented Interfaces
tools.jackson.databind.JacksonModule.SetupContext
Imports
java.util.Collection, java.util.function.UnaryOperator, tools.jackson.core.*, tools.jackson.databind.*, .JacksonModule.SetupContext, tools.jackson.databind.deser.*, tools.jackson.databind.jsontype.NamedType, tools.jackson.databind.ser.SerializerFactory, .Serializers, .ValueSerializerModifier, tools.jackson.databind.type.TypeFactory, .TypeModifier

Default implementation of SetupContext used by ObjectMapper.

Field Summary

Modifier and TypeField and Description
protected final MapperBuilder<?, ?>
protected final ConfigOverrides

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected DeserializerFactory
protected SerializerFactory
protected void
protected void
protected TokenStreamFactory
public JacksonModule.SetupContext
addAbstractTypeResolver(AbstractTypeResolver resolver)

Implements tools.jackson.databind.JacksonModule.SetupContext.addAbstractTypeResolver.

Method that module can use to register additional AbstractTypeResolver instance, to handle resolution of abstract to concrete types (either by defaulting, or by materializing).

public JacksonModule.SetupContext
addDeserializerModifier(ValueDeserializerModifier modifier)

Implements tools.jackson.databind.JacksonModule.SetupContext.addDeserializerModifier.

Method that module can use to register additional modifier objects to customize configuration and construction of bean deserializers.

public JacksonModule.SetupContext
addDeserializers(Deserializers d)

Implements tools.jackson.databind.JacksonModule.SetupContext.addDeserializers.

Method that module can use to register additional deserializers to use for handling types.

public JacksonModule.SetupContext
public JacksonModule.SetupContext
addKeyDeserializers(KeyDeserializers kd)

Implements tools.jackson.databind.JacksonModule.SetupContext.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)

public JacksonModule.SetupContext
addKeySerializers(Serializers s)

Implements tools.jackson.databind.JacksonModule.SetupContext.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 write JsonToken.FIELD_NAME instead of String value).

public JacksonModule.SetupContext
addSerializerModifier(ValueSerializerModifier modifier)

Implements tools.jackson.databind.JacksonModule.SetupContext.addSerializerModifier.

Method that module can use to register additional modifier objects to customize configuration and construction of bean serializers.

public JacksonModule.SetupContext
addSerializers(Serializers s)

Implements tools.jackson.databind.JacksonModule.SetupContext.addSerializers.

Method that module can use to register additional serializers to use for handling types.

public JacksonModule.SetupContext
addTypeModifier(TypeModifier modifier)

Implements tools.jackson.databind.JacksonModule.SetupContext.addTypeModifier.

Method that module can use to register additional TypeModifier instance, which can augment tools.jackson.databind.JavaType instances constructed by tools.jackson.databind.type.TypeFactory.

public JacksonModule.SetupContext
addValueInstantiators(ValueInstantiators instantiators)

Implements tools.jackson.databind.JacksonModule.SetupContext.addValueInstantiators.

Method that module can use to register additional tools.jackson.databind.deser.ValueInstantiators, by adding ValueInstantiators object that gets called when instantatiator is needed by a deserializer.

public JacksonModule.SetupContext
appendAnnotationIntrospector(AnnotationIntrospector ai)

Implements tools.jackson.databind.JacksonModule.SetupContext.appendAnnotationIntrospector.

Method for registering specified AnnotationIntrospector as the lowest priority introspector, chained with existing introspector(s) and called as fallback for cases not otherwise handled.

public void
applyChanges(MapperBuilder<?, ?> b)

Method called after all changes have been applied through this context, to propagate buffered or pending changes (if any) back to builder.

public MutableConfigOverride
configOverride(Class<?> type)

Implements tools.jackson.databind.JacksonModule.SetupContext.configOverride.

"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 DatatypeFeatures
public String
public Version
getMapperVersion()

Implements tools.jackson.databind.JacksonModule.SetupContext.getMapperVersion.

Method that returns version information about ObjectMapper that implements this context.

public Object
getOwner()

Implements tools.jackson.databind.JacksonModule.SetupContext.getOwner.

Fallback access method that allows modules to refer to the MapperBuilder that provided this context.

public JacksonModule.SetupContext
insertAnnotationIntrospector(AnnotationIntrospector ai)

Implements tools.jackson.databind.JacksonModule.SetupContext.insertAnnotationIntrospector.

Method for registering specified AnnotationIntrospector as the highest priority introspector (will be chained with existing introspector(s) which will be used as fallbacks for cases this introspector does not handle)

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public JacksonModule.SetupContext
overrideDefaultNullKeySerializer(ValueSerializer<?> ser)

Implements tools.jackson.databind.JacksonModule.SetupContext.overrideDefaultNullKeySerializer.

Method that module can use to override handler called to write JSON Object key for java.util.Map values.

public JacksonModule.SetupContext
overrideDefaultNullValueSerializer(ValueSerializer<?> ser)

Implements tools.jackson.databind.JacksonModule.SetupContext.overrideDefaultNullValueSerializer.

Method that module can use to override handler called to write Java `null` as a value (Property or Map value, Collection/array element).

public JacksonModule.SetupContext
overrideInjectableValues(UnaryOperator<InjectableValues> v)

Implements tools.jackson.databind.JacksonModule.SetupContext.overrideInjectableValues.

Replace default InjectableValues that have been configured to be used for mapper being built.

public JacksonModule.SetupContext
registerSubtypes(Class<?>... subtypes)

Implements tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Method for registering specified classes as subtypes (of supertype(s) they have)

public JacksonModule.SetupContext
registerSubtypes(NamedType... subtypes)

Implements tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Method for registering specified classes as subtypes (of supertype(s) they have), using specified type names.

public JacksonModule.SetupContext
registerSubtypes(Collection<Class<?>> subtypes)

Implements tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Method for registering specified classes as subtypes (of supertype(s) they have)

public JacksonModule.SetupContext
setMixIn(Class<?> target, Class<?> mixinSource)

Implements tools.jackson.databind.JacksonModule.SetupContext.setMixIn.

Method used for defining mix-in annotations to use for augmenting specified class or interface.

public TokenStreamFactory
public TypeFactory
typeFactory()

Implements tools.jackson.databind.JacksonModule.SetupContext.typeFactory.

Accessor for finding TypeFactory that is currently configured by the context.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_builderback to summary
protected final MapperBuilder<?, ?> _builder
_configOverridesback to summary
protected final ConfigOverrides _configOverrides

Constructor Detail

ModuleContextBaseback to summary
public ModuleContextBase(MapperBuilder<?, ?> b, ConfigOverrides configOverrides)

Method Detail

_deserializerFactoryback to summary
protected DeserializerFactory _deserializerFactory()
_serializerFactoryback to summary
protected SerializerFactory _serializerFactory()
_setback to summary
protected void _set(DeserializerFactory f)
_setback to summary
protected void _set(SerializerFactory f)
_streamFactoryback to summary
protected TokenStreamFactory _streamFactory()
addAbstractTypeResolverback to summary
public JacksonModule.SetupContext addAbstractTypeResolver(AbstractTypeResolver resolver)

Implements tools.jackson.databind.JacksonModule.SetupContext.addAbstractTypeResolver.

Doc from tools.jackson.databind.JacksonModule.SetupContext.addAbstractTypeResolver.

Method that module can use to register additional AbstractTypeResolver instance, to handle resolution of abstract to concrete types (either by defaulting, or by materializing).

Annotations
@Override
addDeserializerModifierback to summary
public JacksonModule.SetupContext addDeserializerModifier(ValueDeserializerModifier modifier)

Implements tools.jackson.databind.JacksonModule.SetupContext.addDeserializerModifier.

Doc from tools.jackson.databind.JacksonModule.SetupContext.addDeserializerModifier.

Method that module can use to register additional modifier objects to customize configuration and construction of bean deserializers.

Annotations
@Override
addDeserializersback to summary
public JacksonModule.SetupContext addDeserializers(Deserializers d)

Implements tools.jackson.databind.JacksonModule.SetupContext.addDeserializers.

Doc from tools.jackson.databind.JacksonModule.SetupContext.addDeserializers.

Method that module can use to register additional deserializers to use for handling types.

Annotations
@Override
addHandlerback to summary
public JacksonModule.SetupContext addHandler(DeserializationProblemHandler handler)

Implements tools.jackson.databind.JacksonModule.SetupContext.addHandler.

Doc from tools.jackson.databind.JacksonModule.SetupContext.addHandler.

Add a deserialization problem handler

Annotations
@Override
addKeyDeserializersback to summary
public JacksonModule.SetupContext addKeyDeserializers(KeyDeserializers kd)

Implements tools.jackson.databind.JacksonModule.SetupContext.addKeyDeserializers.

Doc from tools.jackson.databind.JacksonModule.SetupContext.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)

Annotations
@Override
addKeySerializersback to summary
public JacksonModule.SetupContext addKeySerializers(Serializers s)

Implements tools.jackson.databind.JacksonModule.SetupContext.addKeySerializers.

Doc from tools.jackson.databind.JacksonModule.SetupContext.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 write JsonToken.FIELD_NAME instead of String value).

Annotations
@Override
addSerializerModifierback to summary
public JacksonModule.SetupContext addSerializerModifier(ValueSerializerModifier modifier)

Implements tools.jackson.databind.JacksonModule.SetupContext.addSerializerModifier.

Doc from tools.jackson.databind.JacksonModule.SetupContext.addSerializerModifier.

Method that module can use to register additional modifier objects to customize configuration and construction of bean serializers.

Annotations
@Override
addSerializersback to summary
public JacksonModule.SetupContext addSerializers(Serializers s)

Implements tools.jackson.databind.JacksonModule.SetupContext.addSerializers.

Doc from tools.jackson.databind.JacksonModule.SetupContext.addSerializers.

Method that module can use to register additional serializers to use for handling types.

Annotations
@Override
addTypeModifierback to summary
public JacksonModule.SetupContext addTypeModifier(TypeModifier modifier)

Implements tools.jackson.databind.JacksonModule.SetupContext.addTypeModifier.

Doc from tools.jackson.databind.JacksonModule.SetupContext.addTypeModifier.

Method that module can use to register additional TypeModifier instance, which can augment tools.jackson.databind.JavaType instances constructed by tools.jackson.databind.type.TypeFactory.

Annotations
@Override
addValueInstantiatorsback to summary
public JacksonModule.SetupContext addValueInstantiators(ValueInstantiators instantiators)

Implements tools.jackson.databind.JacksonModule.SetupContext.addValueInstantiators.

Doc from tools.jackson.databind.JacksonModule.SetupContext.addValueInstantiators.

Method that module can use to register additional tools.jackson.databind.deser.ValueInstantiators, by adding ValueInstantiators object that gets called when instantatiator is needed by a deserializer.

Annotations
@Override
appendAnnotationIntrospectorback to summary
public JacksonModule.SetupContext appendAnnotationIntrospector(AnnotationIntrospector ai)

Implements tools.jackson.databind.JacksonModule.SetupContext.appendAnnotationIntrospector.

Doc from tools.jackson.databind.JacksonModule.SetupContext.appendAnnotationIntrospector.

Method for registering specified AnnotationIntrospector as the lowest priority introspector, chained with existing introspector(s) and called as fallback for cases not otherwise handled.

Annotations
@Override
applyChangesback to summary
public void applyChanges(MapperBuilder<?, ?> b)

Method called after all changes have been applied through this context, to propagate buffered or pending changes (if any) back to builder. Note that base implementation does nothing here; it is only provded in case sub-classes might need it.

configOverrideback to summary
public MutableConfigOverride configOverride(Class<?> type)

Implements tools.jackson.databind.JacksonModule.SetupContext.configOverride.

Doc from tools.jackson.databind.JacksonModule.SetupContext.configOverride.

"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.util.Date (possibly further overridden by per-property annotations)
Annotations
@Override
datatypeFeaturesback to summary
public DatatypeFeatures datatypeFeatures()

Implements tools.jackson.databind.JacksonModule.SetupContext.datatypeFeatures.

Annotations
@Override
getFormatNameback to summary
public String getFormatName()

Implements tools.jackson.databind.JacksonModule.SetupContext.getFormatName.

Annotations
@Override
getMapperVersionback to summary
public Version getMapperVersion()

Implements tools.jackson.databind.JacksonModule.SetupContext.getMapperVersion.

Doc from tools.jackson.databind.JacksonModule.SetupContext.getMapperVersion.

Method that returns version information about ObjectMapper that 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.

Annotations
@Override
getOwnerback to summary
public Object getOwner()

Implements tools.jackson.databind.JacksonModule.SetupContext.getOwner.

Doc from tools.jackson.databind.JacksonModule.SetupContext.getOwner.

Fallback access method that allows modules to refer to the MapperBuilder that provided this context. It should NOT be needed by most modules; and ideally should not be used -- however, there may be cases where this may be necessary due to various design constraints.

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 force casting, to make caller aware that this is a fallback accessor, used only when everything else fails: type is, however, guaranteed to be MapperBuilder (and more specifically format-specific subtype that mapper constructed, in case format-specific access is needed).

Annotations
@Override
insertAnnotationIntrospectorback to summary
public JacksonModule.SetupContext insertAnnotationIntrospector(AnnotationIntrospector ai)

Implements tools.jackson.databind.JacksonModule.SetupContext.insertAnnotationIntrospector.

Doc from tools.jackson.databind.JacksonModule.SetupContext.insertAnnotationIntrospector.

Method for registering specified AnnotationIntrospector as the highest priority introspector (will be chained with existing introspector(s) which will be used as fallbacks for cases this introspector does not handle)

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(MapperFeature f)

Implements tools.jackson.databind.JacksonModule.SetupContext.isEnabled.

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(DeserializationFeature f)

Implements tools.jackson.databind.JacksonModule.SetupContext.isEnabled.

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(SerializationFeature f)

Implements tools.jackson.databind.JacksonModule.SetupContext.isEnabled.

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(TokenStreamFactory.Feature f)

Implements tools.jackson.databind.JacksonModule.SetupContext.isEnabled.

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(StreamReadFeature f)

Implements tools.jackson.databind.JacksonModule.SetupContext.isEnabled.

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(StreamWriteFeature f)

Implements tools.jackson.databind.JacksonModule.SetupContext.isEnabled.

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(DatatypeFeature f)

Implements tools.jackson.databind.JacksonModule.SetupContext.isEnabled.

Annotations
@Override
overrideDefaultNullKeySerializerback to summary
public JacksonModule.SetupContext overrideDefaultNullKeySerializer(ValueSerializer<?> ser)

Implements tools.jackson.databind.JacksonModule.SetupContext.overrideDefaultNullKeySerializer.

Doc from tools.jackson.databind.JacksonModule.SetupContext.overrideDefaultNullKeySerializer.

Method that module can use to override handler called to write JSON Object key for java.util.Map values.

Annotations
@Override
overrideDefaultNullValueSerializerback to summary
public JacksonModule.SetupContext overrideDefaultNullValueSerializer(ValueSerializer<?> ser)

Implements tools.jackson.databind.JacksonModule.SetupContext.overrideDefaultNullValueSerializer.

Doc from tools.jackson.databind.JacksonModule.SetupContext.overrideDefaultNullValueSerializer.

Method that module can use to override handler called to write Java `null` as a value (Property or Map value, Collection/array element).

Annotations
@Override
overrideInjectableValuesback to summary
public JacksonModule.SetupContext overrideInjectableValues(UnaryOperator<InjectableValues> v)

Implements tools.jackson.databind.JacksonModule.SetupContext.overrideInjectableValues.

Doc from tools.jackson.databind.JacksonModule.SetupContext.overrideInjectableValues.

Replace default InjectableValues that have been configured to be used for mapper being built.

Annotations
@Override
registerSubtypesback to summary
public JacksonModule.SetupContext registerSubtypes(Class<?>... subtypes)

Implements tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Doc from tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Method for registering specified classes as subtypes (of supertype(s) they have)

Annotations
@Override
registerSubtypesback to summary
public JacksonModule.SetupContext registerSubtypes(NamedType... subtypes)

Implements tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Doc from tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Method for registering specified classes as subtypes (of supertype(s) they have), using specified type names.

Annotations
@Override
registerSubtypesback to summary
public JacksonModule.SetupContext registerSubtypes(Collection<Class<?>> subtypes)

Implements tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Doc from tools.jackson.databind.JacksonModule.SetupContext.registerSubtypes.

Method for registering specified classes as subtypes (of supertype(s) they have)

Annotations
@Override
setMixInback to summary
public JacksonModule.SetupContext setMixIn(Class<?> target, Class<?> mixinSource)

Implements tools.jackson.databind.JacksonModule.SetupContext.setMixIn.

Doc from tools.jackson.databind.JacksonModule.SetupContext.setMixIn.

Method used for defining mix-in annotations to use for augmenting specified class or interface. All annotations from mixinSource are taken to override annotations that target (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.

Annotations
@Override
tokenStreamFactoryback to summary
public TokenStreamFactory tokenStreamFactory()

Implements tools.jackson.databind.JacksonModule.SetupContext.tokenStreamFactory.

Annotations
@Override
typeFactoryback to summary
public TypeFactory typeFactory()

Implements tools.jackson.databind.JacksonModule.SetupContext.typeFactory.

Doc from tools.jackson.databind.JacksonModule.SetupContext.typeFactory.

Accessor for finding TypeFactory that is currently configured by the context.

Note

since it is possible that other modules might change or replace TypeFactory, use of this method adds order-dependency for registrations.

Annotations
@Override