Top Description Fields Constructors Methods
tools.jackson.databind

public final Class DeserializationConfig

extends MapperConfigBase<DeserializationFeature, DeserializationConfig>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
tools.jackson.core.*, tools.jackson.databind.cfg.*, tools.jackson.databind.deser.DeserializationProblemHandler, tools.jackson.databind.introspect.*, tools.jackson.databind.jsontype.*, tools.jackson.databind.type.LogicalType, .TypeFactory, tools.jackson.databind.util.ArrayIterator, .Converter, .LinkedNode, .RootNameLookup

Object that contains baseline configuration for deserialization process. An instance is owned by ObjectMapper, which passes an immutable instance to be used for deserialization process.

Note that instances are considered immutable and as such no copies should need to be created for sharing; all copying is done with "fluent factory" methods.

Field Summary

Modifier and TypeField and Description
protected final AbstractTypeResolver[]
_abstractTypeResolvers

List of objects that may be able to resolve abstract types to concrete types.

protected final CoercionConfigs
_coercionConfigs

Configured coercion rules for coercions from secondary input shapes.

protected final int
protected final int
protected final LinkedNode<DeserializationProblemHandler>
_problemHandlers

Linked list that contains all registered problem handlers.

protected final int
private static final long
Inherited from tools.jackson.databind.cfg.MapperConfigBase:
_attributes_classIntrospector_configOverrides_datatypeFeatures_mixIns_rootName_rootNames_subtypeResolver_typeFactory_typeResolverProvider_viewEMPTY_OVERRIDE

Constructor Summary

AccessConstructor and Description
public
DeserializationConfig(MapperBuilder<?, ?> b, long mapperFeatures, int deserFeatures, int streamReadFeatures, int formatReadFeatures, ConfigOverrides configOverrides, CoercionConfigs coercionConfigs, TypeFactory tf, ClassIntrospector classIntr, MixInHandler mixins, SubtypeResolver str, ContextAttributes defaultAttrs, RootNameLookup rootNames, AbstractTypeResolver[] atrs)

private
DeserializationConfig(DeserializationConfig src, int deserFeatures, int streamReadFeatures, int formatReadFeatures)

private
private
private
private
protected
protected

Method Summary

Modifier and TypeMethod and Description
private JavaType
_mapAbstractType2(JavaType type)

Method that will find abstract type mapping for specified type, doing a single lookup through registered abstract type resolvers; will not do recursive lookups.

protected final DeserializationConfig
protected final DeserializationConfig
public Iterable<AbstractTypeResolver>
public CoercionAction

Returns:

CoercionAction configured for specific coercion
findCoercionAction
(LogicalType
Logical target type of coercion
targetType
,
Class<?>
Physical target type of coercion
targetClass
,
CoercionInputShape
Input shape to coerce from
inputShape
)

General-purpose accessor for finding what to do when specified coercion from shape that is now always allowed to be coerced from is requested.

public CoercionAction

Returns:

CoercionAction configured for specified coercion from blank string
findCoercionFromBlankString
(LogicalType
Logical target type of coercion
targetType
,
Class<?>
Physical target type of coercion
targetClass
,
CoercionAction
Return value to use in case "blanks as empty" is not allowed
actionIfBlankNotAllowed
)

More specialized accessor called in case of input being a blank String (one consisting of only white space characters with length of at least one).

public Converter<Object, Object>
protected BaseSettings
public final int
getDeserializationFeatures()

Bulk access method for getting the bit mask of all DeserializationFeatures that are enabled.

public int
public LinkedNode<DeserializationProblemHandler>
getProblemHandlers()

Method for getting head of the problem handler chain.

public int
public boolean
public final boolean
hasDeserializationFeatures(int featureMask)

Bulk access method for checking that all features specified by mask are enabled.

public final boolean
public final boolean
hasSomeOfFeatures(int featureMask)

Bulk access method for checking that at least one of features specified by mask is enabled.

public final boolean
public final boolean
public JavaType
public final boolean
requiresFullValue()

Convenience method equivalent to: isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)

public boolean
useRootWrapping()

Implements abstract tools.jackson.databind.cfg.MapperConfig.useRootWrapping.

Accessor for checking whether configuration indicates that "root wrapping" (use of an extra property/name pair at root level) is expected or not.

public DeserializationConfig
with(ContextAttributes attrs)

Implements abstract tools.jackson.databind.cfg.MapperConfigBase.with.

Method for constructing an instance that has specified contextual attributes.

public DeserializationConfig
with(DeserializationFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

public DeserializationConfig
with(DeserializationFeature first, DeserializationFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

public DeserializationConfig
with(StreamReadFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

public DeserializationConfig
with(FormatFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

public DeserializationConfig
withFeatures(DeserializationFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

public DeserializationConfig
withFeatures(StreamReadFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

public DeserializationConfig
withFeatures(FormatFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

public DeserializationConfig
withHandler(DeserializationProblemHandler h)

Method that can be used to add a handler that can (try to) resolve non-fatal deserialization problems.

public DeserializationConfig
withNoProblemHandlers()

Method for removing all configured problem handlers; usually done to replace existing handler(s) with different one(s)

public DeserializationConfig
without(DeserializationFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.

public DeserializationConfig
without(DeserializationFeature first, DeserializationFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features disabled.

public DeserializationConfig
without(StreamReadFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.

public DeserializationConfig
without(FormatFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.

public DeserializationConfig
withoutFeatures(DeserializationFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features disabled.

public DeserializationConfig
withoutFeatures(StreamReadFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features disabled.

public DeserializationConfig
withoutFeatures(FormatFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features disabled.

public DeserializationConfig
withRootName(PropertyName rootName)

Implements abstract tools.jackson.databind.cfg.MapperConfigBase.withRootName.

Method for constructing and returning a new instance with different root name to use (none, if null).

public DeserializationConfig
withView(Class<?> view)

Implements abstract tools.jackson.databind.cfg.MapperConfigBase.withView.

Method for constructing and returning a new instance with different view to use.

Inherited from tools.jackson.databind.cfg.MapperConfigBase:
_createConverter_datatypeFeaturesclassIntrospectorInstanceconstructTypeconstructTypefindConfigOverridefindMixInClassForfindRootNamefindRootNamegetActiveViewgetAttributesgetConfigOverridegetDatatypeFeaturesgetDefaultInclusiongetDefaultMergeablegetDefaultMergeablegetDefaultNullHandlinggetDefaultPropertyFormatgetDefaultPropertyIgnoralsgetDefaultPropertyIgnoralsgetDefaultPropertyInclusiongetDefaultPropertyInclusiongetDefaultPropertyInclusionsgetDefaultVisibilityCheckergetDefaultVisibilityCheckergetFullRootNamegetSubtypeResolvergetTypeFactorygetTypeResolverProviderhasMixInsisEnabledmixInCountsnapshotwithwithwithwithwithwithwithwithwithwithAttributewithAttributeswithFeatureswithoutwithoutAttributewithoutFeatureswithRootName

Field Detail

_abstractTypeResolversback to summary
protected final AbstractTypeResolver[] _abstractTypeResolvers

List of objects that may be able to resolve abstract types to concrete types. Used by functionality like "mr Bean" to materialize types as needed, although may be used for other kinds of defaulting as well.

_coercionConfigsback to summary
protected final CoercionConfigs _coercionConfigs

Configured coercion rules for coercions from secondary input shapes.

_deserFeaturesback to summary
protected final int _deserFeatures

Set of DeserializationFeatures enabled.

_formatReadFeaturesback to summary
protected final int _formatReadFeatures

States of tools.jackson.core.FormatFeatures to enable/disable.

_problemHandlersback to summary
protected final LinkedNode<DeserializationProblemHandler> _problemHandlers

Linked list that contains all registered problem handlers. Implementation as front-added linked list allows for sharing of the list (tail) without copying the list.

_streamReadFeaturesback to summary
protected final int _streamReadFeatures

States of tools.jackson.core.StreamReadFeatures to enable/disable.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.cfg.MapperConfig.serialVersionUID.

Constructor Detail

DeserializationConfigback to summary
public DeserializationConfig(MapperBuilder<?, ?> b, long mapperFeatures, int deserFeatures, int streamReadFeatures, int formatReadFeatures, ConfigOverrides configOverrides, CoercionConfigs coercionConfigs, TypeFactory tf, ClassIntrospector classIntr, MixInHandler mixins, SubtypeResolver str, ContextAttributes defaultAttrs, RootNameLookup rootNames, AbstractTypeResolver[] atrs)
Since
3.0
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, int deserFeatures, int streamReadFeatures, int formatReadFeatures)
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, BaseSettings base)
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, LinkedNode<DeserializationProblemHandler> problemHandlers, AbstractTypeResolver[] atr)
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, PropertyName rootName)
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, Class<?> view)
DeserializationConfigback to summary
protected DeserializationConfig(DeserializationConfig src, ContextAttributes attrs)
DeserializationConfigback to summary
protected DeserializationConfig(DeserializationConfig src, DatatypeFeatures dtFeatures)

Method Detail

_mapAbstractType2back to summary
private JavaType _mapAbstractType2(JavaType type)

Method that will find abstract type mapping for specified type, doing a single lookup through registered abstract type resolvers; will not do recursive lookups.

_withback to summary
protected final DeserializationConfig _with(DatatypeFeatures dtFeatures)

Implements abstract tools.jackson.databind.cfg.MapperConfigBase._with.

Annotations
@Override
_withBaseback to summary
protected final DeserializationConfig _withBase(BaseSettings newBase)

Implements abstract tools.jackson.databind.cfg.MapperConfigBase._withBase.

Annotations
@Override
abstractTypeResolversback to summary
public Iterable<AbstractTypeResolver> abstractTypeResolvers()
Since
3.0
findCoercionActionback to summary
public CoercionAction findCoercionAction(LogicalType targetType, Class<?> targetClass, CoercionInputShape inputShape)

General-purpose accessor for finding what to do when specified coercion from shape that is now always allowed to be coerced from is requested.

Parameters
targetType:LogicalType

Logical target type of coercion

targetClass:Class<?>

Physical target type of coercion

inputShape:CoercionInputShape

Input shape to coerce from

Returns:CoercionAction

CoercionAction configured for specific coercion

Since
2.12
findCoercionFromBlankStringback to summary
public CoercionAction findCoercionFromBlankString(LogicalType targetType, Class<?> targetClass, CoercionAction actionIfBlankNotAllowed)

More specialized accessor called in case of input being a blank String (one consisting of only white space characters with length of at least one). Will basically first determine if "blank as empty" is allowed: if not, returns actionIfBlankNotAllowed, otherwise returns action for CoercionInputShape#EmptyString.

Parameters
targetType:LogicalType

Logical target type of coercion

targetClass:Class<?>

Physical target type of coercion

actionIfBlankNotAllowed:CoercionAction

Return value to use in case "blanks as empty" is not allowed

Returns:CoercionAction

CoercionAction configured for specified coercion from blank string

Since
2.12
findDeserializationConverterback to summary
public Converter<Object, Object> findDeserializationConverter(Annotated ann)
getBaseSettingsback to summary
protected BaseSettings getBaseSettings()
getDeserializationFeaturesback to summary
public final int getDeserializationFeatures()

Bulk access method for getting the bit mask of all DeserializationFeatures that are enabled.

getFormatReadFeaturesback to summary
public int getFormatReadFeatures()
Since
3.0
getProblemHandlersback to summary
public LinkedNode<DeserializationProblemHandler> getProblemHandlers()

Method for getting head of the problem handler chain. May be null, if no handlers have been added.

getStreamReadFeaturesback to summary
public int getStreamReadFeatures()
Since
3.0
hasAbstractTypeResolversback to summary
public boolean hasAbstractTypeResolvers()
Since
3.0
hasDeserializationFeaturesback to summary
public final boolean hasDeserializationFeatures(int featureMask)

Bulk access method for checking that all features specified by mask are enabled.

hasFormatFeatureback to summary
public final boolean hasFormatFeature(FormatFeature f)
hasSomeOfFeaturesback to summary
public final boolean hasSomeOfFeatures(int featureMask)

Bulk access method for checking that at least one of features specified by mask is enabled.

isEnabledback to summary
public final boolean isEnabled(DeserializationFeature f)
isEnabledback to summary
public final boolean isEnabled(StreamReadFeature f)
mapAbstractTypeback to summary
public JavaType mapAbstractType(JavaType type)
Since
3.0
requiresFullValueback to summary
public final boolean requiresFullValue()

Convenience method equivalent to: isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)

useRootWrappingback to summary
public boolean useRootWrapping()

Implements abstract tools.jackson.databind.cfg.MapperConfig.useRootWrapping.

Doc from tools.jackson.databind.cfg.MapperConfig.useRootWrapping.

Accessor for checking whether configuration indicates that "root wrapping" (use of an extra property/name pair at root level) is expected or not.

Annotations
@Override
withback to summary
public DeserializationConfig with(ContextAttributes attrs)

Implements abstract tools.jackson.databind.cfg.MapperConfigBase.with.

Doc from tools.jackson.databind.cfg.MapperConfigBase.with.

Method for constructing an instance that has specified contextual attributes.

Annotations
@Override
withback to summary
public DeserializationConfig with(DeserializationFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

withback to summary
public DeserializationConfig with(DeserializationFeature first, DeserializationFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

withback to summary
public DeserializationConfig with(StreamReadFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

withback to summary
public DeserializationConfig with(FormatFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

withFeaturesback to summary
public DeserializationConfig withFeatures(DeserializationFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

withFeaturesback to summary
public DeserializationConfig withFeatures(StreamReadFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

withFeaturesback to summary
public DeserializationConfig withFeatures(FormatFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features enabled.

withHandlerback to summary
public DeserializationConfig withHandler(DeserializationProblemHandler h)

Method that can be used to add a handler that can (try to) resolve non-fatal deserialization problems.

withNoProblemHandlersback to summary
public DeserializationConfig withNoProblemHandlers()

Method for removing all configured problem handlers; usually done to replace existing handler(s) with different one(s)

withoutback to summary
public DeserializationConfig without(DeserializationFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.

withoutback to summary
public DeserializationConfig without(DeserializationFeature first, DeserializationFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features disabled.

withoutback to summary
public DeserializationConfig without(StreamReadFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.

withoutback to summary
public DeserializationConfig without(FormatFeature feature)

Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.

withoutFeaturesback to summary
public DeserializationConfig withoutFeatures(DeserializationFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features disabled.

withoutFeaturesback to summary
public DeserializationConfig withoutFeatures(StreamReadFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features disabled.

withoutFeaturesback to summary
public DeserializationConfig withoutFeatures(FormatFeature... features)

Fluent factory method that will construct and return a new configuration object instance with specified features disabled.

withRootNameback to summary
public DeserializationConfig withRootName(PropertyName rootName)

Implements abstract tools.jackson.databind.cfg.MapperConfigBase.withRootName.

Doc from tools.jackson.databind.cfg.MapperConfigBase.withRootName.

Method for constructing and returning a new instance with different root name to use (none, if null).

Note that when a root name is set to a non-Empty String, this will automatically force use of root element wrapping with given name. If empty String passed, will disable root name wrapping; and if null used, will instead use SerializationFeature to determine if to use wrapping, and annotation (or default name) for actual root name to use.

Annotations
@Override
withViewback to summary
public DeserializationConfig withView(Class<?> view)

Implements abstract tools.jackson.databind.cfg.MapperConfigBase.withView.

Doc from tools.jackson.databind.cfg.MapperConfigBase.withView.

Method for constructing and returning a new instance with different view to use.

Annotations
@Override