Top Description Fields Constructors Methods
com.fasterxml.jackson.databind

public final Class DeserializationConfig

extends MapperConfigBase<DeserializationFeature, DeserializationConfig>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.*, com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.json.JsonReadFeature, com.fasterxml.jackson.databind.cfg.*, com.fasterxml.jackson.databind.deser.DeserializationProblemHandler, com.fasterxml.jackson.databind.introspect.*, com.fasterxml.jackson.databind.jsontype.*, com.fasterxml.jackson.databind.node.JsonNodeFactory, com.fasterxml.jackson.databind.type.LogicalType, com.fasterxml.jackson.databind.util.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 CoercionConfigs
protected final ConstructorDetector
protected final int
protected final int
protected final int
protected final JsonNodeFactory
_nodeFactory

Factory used for constructing com.fasterxml.jackson.databind.JsonNode instances.

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

Linked list that contains all registered problem handlers.

private static final int
private static final long
Inherited from com.fasterxml.jackson.databind.cfg.MapperConfigBase:
_attributes_configOverrides_datatypeFeatures_mixIns_rootName_rootNames_subtypeResolver_viewEMPTY_OVERRIDE

Constructor Summary

AccessConstructor and Description
public
DeserializationConfig(BaseSettings base, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides, CoercionConfigs coercionConfigs, DatatypeFeatures datatypeFeatures)

Constructor used by ObjectMapper to create default configuration object instance.

protected
DeserializationConfig(DeserializationConfig src, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides, CoercionConfigs coercionConfigs)

Copy-constructor used for making a copy used by new ObjectMapper.

private
DeserializationConfig(DeserializationConfig src, long mapperFeatures, int deserFeatures, int parserFeatures, int parserFeatureMask, int formatFeatures, int formatFeatureMask)

private
DeserializationConfig(DeserializationConfig src, SubtypeResolver str)

Copy constructor used to create a non-shared instance with given mix-in annotation definitions and subtype resolver.

private
private
private
private
private
private
protected
protected
protected

Method Summary

Modifier and TypeMethod and Description
protected final DeserializationConfig
protected final DeserializationConfig
private DeserializationConfig
protected final DeserializationConfig
private DeserializationConfig
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 TypeDeserializer
findTypeDeserializer(JavaType baseType)

Helper method that is needed to properly handle polymorphic referenced types, such as types referenced by java.util.concurrent.atomic.AtomicReference, or various "optional" types.

protected BaseSettings
public ConstructorDetector
public final int
getDeserializationFeatures()

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

public final JsonNodeFactory
public LinkedNode<DeserializationProblemHandler>
getProblemHandlers()

Method for getting head of the problem handler chain.

public final boolean
hasDeserializationFeatures(int featureMask)

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

public final boolean
hasSomeOfFeatures(int featureMask)

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

public JsonParser
initialize(JsonParser p)

Method called by ObjectMapper and ObjectReader to modify those com.fasterxml.jackson.core.JsonParser.Feature settings that have been configured via this config instance.

public JsonParser
public BeanDescription
introspect(JavaType
Type of class to be introspected
type
)

Method that will introspect full bean properties for the purpose of building a bean deserializer

public BeanDescription
introspectForBuilder(JavaType builderType, BeanDescription valueTypeDesc)

public BeanDescription
introspectForCreation(JavaType type)

Method that will introspect subset of bean properties needed to construct bean instance.

public final boolean

Returns:

True if feature is enabled; false otherwise
isEnabled
(DeserializationFeature
Feature to check
feature
)

Accessor for checking whether give DeserializationFeature is enabled or not.

public final boolean
public final boolean

Returns:

True if feature is enabled; false otherwise
isEnabled
(DatatypeFeature
Feature to check
feature
)

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfig.isEnabled.

Accessor for checking whether give DatatypeFeature is enabled or not.

public final boolean
requiresFullValue()

Convenience method equivalent to: isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)

public boolean
useRootWrapping()

Implements abstract com.fasterxml.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(SubtypeResolver str)

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfigBase.with.

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

public DeserializationConfig
with(ContextAttributes attrs)

Implements abstract com.fasterxml.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(JsonParser.Feature 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
with(JsonNodeFactory f)

Fluent factory method that will construct a new instance with specified JsonNodeFactory

public DeserializationConfig
with(ConstructorDetector ctorDetector)

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(JsonParser.Feature... 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(JsonParser.Feature 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(JsonParser.Feature... 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
to use: if null, means "use default" (clear setting); if empty String ("") means that no root name wrapping is used; otherwise defines root name to use.
rootName
)

Implements abstract com.fasterxml.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 com.fasterxml.jackson.databind.cfg.MapperConfigBase.withView.

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

Inherited from com.fasterxml.jackson.databind.cfg.MapperConfigBase:
_datatypeFeaturescopyfindConfigOverridefindMixInClassForfindRootNamefindRootNamegetActiveViewgetAttributesgetConfigOverridegetDatatypeFeaturesgetDefaultInclusiongetDefaultMergeablegetDefaultMergeablegetDefaultPropertyFormatgetDefaultPropertyIgnoralsgetDefaultPropertyIgnoralsgetDefaultPropertyInclusiongetDefaultPropertyInclusiongetDefaultPropertyInclusionsgetDefaultSetterInfogetDefaultVisibilityCheckergetDefaultVisibilityCheckergetFullRootNamegetRootNamegetSubtypeResolvermixInCountwithwithwithwithwithwithwithwithwithwithwithwithwithwithwithwithwithAppendedAnnotationIntrospectorwithAttributewithAttributeswithFeatureswithInsertedAnnotationIntrospectorwithoutwithoutwithoutAttributewithoutFeatureswithRootName

Field Detail

_coercionConfigsback to summary
protected final CoercionConfigs _coercionConfigs
Since
2.12
_ctorDetectorback to summary
protected final ConstructorDetector _ctorDetector
Since
2.12
_deserFeaturesback to summary
protected final int _deserFeatures

Set of DeserializationFeatures enabled.

_formatReadFeaturesback to summary
protected final int _formatReadFeatures

States of com.fasterxml.jackson.core.FormatFeatures to enable/disable.

Since
2.7
_formatReadFeaturesToChangeback to summary
protected final int _formatReadFeaturesToChange

Bitflag of com.fasterxml.jackson.core.FormatFeatures to enable/disable

Since
2.7
_nodeFactoryback to summary
protected final JsonNodeFactory _nodeFactory

Factory used for constructing com.fasterxml.jackson.databind.JsonNode instances.

_parserFeaturesback to summary
protected final int _parserFeatures

States of com.fasterxml.jackson.core.JsonParser.Features to enable/disable.

_parserFeaturesToChangeback to summary
protected final int _parserFeaturesToChange

Bitflag of com.fasterxml.jackson.core.JsonParser.Features 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.

DESER_FEATURE_DEFAULTSback to summary
private static final int DESER_FEATURE_DEFAULTS
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.cfg.MapperConfig.serialVersionUID.

Constructor Detail

DeserializationConfigback to summary
public DeserializationConfig(BaseSettings base, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides, CoercionConfigs coercionConfigs, DatatypeFeatures datatypeFeatures)

Constructor used by ObjectMapper to create default configuration object instance.

Since
2.14
DeserializationConfigback to summary
protected DeserializationConfig(DeserializationConfig src, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides, CoercionConfigs coercionConfigs)

Copy-constructor used for making a copy used by new ObjectMapper.

Since
2.14
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, long mapperFeatures, int deserFeatures, int parserFeatures, int parserFeatureMask, int formatFeatures, int formatFeatureMask)
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, SubtypeResolver str)

Copy constructor used to create a non-shared instance with given mix-in annotation definitions and subtype resolver.

DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, BaseSettings base)
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, JsonNodeFactory f)
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, ConstructorDetector ctorDetector)
DeserializationConfigback to summary
private DeserializationConfig(DeserializationConfig src, LinkedNode<DeserializationProblemHandler> problemHandlers)
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, SimpleMixInResolver mixins)
DeserializationConfigback to summary
protected DeserializationConfig(DeserializationConfig src, DatatypeFeatures datatypeFeatures)
Since
2.14

Method Detail

_withback to summary
protected final DeserializationConfig _with(DatatypeFeatures dtFeatures)

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfigBase._with.

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

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfigBase._withBase.

Annotations
@Override
_withJsonReadFeaturesback to summary
private DeserializationConfig _withJsonReadFeatures(FormatFeature... features)
_withMapperFeaturesback to summary
protected final DeserializationConfig _withMapperFeatures(long mapperFeatures)

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfigBase._withMapperFeatures.

Annotations
@Override
_withoutJsonReadFeaturesback to summary
private DeserializationConfig _withoutJsonReadFeatures(FormatFeature... features)
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
findTypeDeserializerback to summary
public TypeDeserializer findTypeDeserializer(JavaType baseType) throws JsonMappingException

Helper method that is needed to properly handle polymorphic referenced types, such as types referenced by java.util.concurrent.atomic.AtomicReference, or various "optional" types.

Since
2.4
getBaseSettingsback to summary
protected BaseSettings getBaseSettings()
getConstructorDetectorback to summary
public ConstructorDetector getConstructorDetector()

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfig.getConstructorDetector.

Annotations
@Override
Since
2.12
getDeserializationFeaturesback to summary
public final int getDeserializationFeatures()

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

getNodeFactoryback to summary
public final JsonNodeFactory getNodeFactory()
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.

hasDeserializationFeaturesback to summary
public final boolean hasDeserializationFeatures(int featureMask)

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

Since
2.3
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.

Since
2.6
initializeback to summary
public JsonParser initialize(JsonParser p)

Method called by ObjectMapper and ObjectReader to modify those com.fasterxml.jackson.core.JsonParser.Feature settings that have been configured via this config instance.

Since
2.5
initializeback to summary
public JsonParser initialize(JsonParser p, FormatSchema schema)
Since
2.12
introspectback to summary
public BeanDescription introspect(JavaType type)

Method that will introspect full bean properties for the purpose of building a bean deserializer

Parameters
type:JavaType

Type of class to be introspected

introspectForBuilderback to summary
public BeanDescription introspectForBuilder(JavaType builderType, BeanDescription valueTypeDesc)
Since
2.12
introspectForCreationback to summary
public BeanDescription introspectForCreation(JavaType type)

Method that will introspect subset of bean properties needed to construct bean instance.

isEnabledback to summary
public final boolean isEnabled(DeserializationFeature feature)

Accessor for checking whether give DeserializationFeature is enabled or not.

Parameters
feature:DeserializationFeature

Feature to check

Returns:boolean

True if feature is enabled; false otherwise

isEnabledback to summary
public final boolean isEnabled(JsonParser.Feature f, JsonFactory factory)
isEnabledback to summary
public final boolean isEnabled(DatatypeFeature feature)

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfig.isEnabled.

Accessor for checking whether give DatatypeFeature is enabled or not.

Parameters
feature:DatatypeFeature

Feature to check

Returns:boolean

True if feature is enabled; false otherwise

Annotations
@Override
Since
2.14
requiresFullValueback to summary
public final boolean requiresFullValue()

Convenience method equivalent to: isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)

Since
2.9
useRootWrappingback to summary
public boolean useRootWrapping()

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfig.useRootWrapping.

Doc from com.fasterxml.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(SubtypeResolver str)

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfigBase.with.

Doc from com.fasterxml.jackson.databind.cfg.MapperConfigBase.with.

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

Note

make sure to register new instance with ObjectMapper if directly calling this method.

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

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfigBase.with.

Doc from com.fasterxml.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(JsonParser.Feature feature)

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

Since
2.5
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.

Since
2.7
withback to summary
public DeserializationConfig with(JsonNodeFactory f)

Fluent factory method that will construct a new instance with specified JsonNodeFactory

withback to summary
public DeserializationConfig with(ConstructorDetector ctorDetector)
Since
2.12
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(JsonParser.Feature... features)

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

Since
2.5
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.

Since
2.7
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(JsonParser.Feature feature)

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

Since
2.5
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.

Since
2.7
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(JsonParser.Feature... features)

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

Since
2.5
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.

Since
2.7
withRootNameback to summary
public DeserializationConfig withRootName(PropertyName rootName)

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfigBase.withRootName.

Doc from com.fasterxml.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.

Parameters
rootName:PropertyName

to use: if null, means "use default" (clear setting); if empty String ("") means that no root name wrapping is used; otherwise defines root name to use.

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

Implements abstract com.fasterxml.jackson.databind.cfg.MapperConfigBase.withView.

Doc from com.fasterxml.jackson.databind.cfg.MapperConfigBase.withView.

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

Annotations
@Override