com.fasterxml.jackson.databind

## Class DeserializationConfig

- java.lang.Object
- - com.fasterxml.jackson.databind.cfg.MapperConfig<T>
  - - com.fasterxml.jackson.databind.cfg.MapperConfigBase<DeserializationFeature,DeserializationConfig>
    - - com.fasterxml.jackson.databind.DeserializationConfig

All Implemented Interfaces:
  ClassIntrospector.MixInResolver, Serializable

    public final class DeserializationConfig
    extends MapperConfigBase<DeserializationFeature,DeserializationConfig>
    implements Serializable

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.

See Also:
  Serialized Form

### Field Summary

Fields
`protected CoercionConfigs` `_coercionConfigs`
`protected ConstructorDetector` `_ctorDetector`
`protected int` `_deserFeatures` Set of `DeserializationFeature`s enabled.
`protected int` `_formatReadFeatures` States of `FormatFeature`s to enable/disable.
`protected int` `_formatReadFeaturesToChange` Bitflag of `FormatFeature`s to enable/disable
`protected JsonNodeFactory` `_nodeFactory` Factory used for constructing `JsonNode` instances.
`protected int` `_parserFeatures` States of `JsonParser.Feature`s to enable/disable.
`protected int` `_parserFeaturesToChange` Bitflag of `JsonParser.Feature`s to enable/disable
`protected LinkedNode<DeserializationProblemHandler>` `_problemHandlers` Linked list that contains all registered problem handlers.

### Fields inherited from class com.fasterxml.jackson.databind.cfg.MapperConfigBase

`_attributes, _configOverrides, _datatypeFeatures, _mixIns, _rootName, _rootNames, _subtypeResolver, _view, EMPTY_OVERRIDE`

### Fields inherited from class com.fasterxml.jackson.databind.cfg.MapperConfig

`_base, _mapperFeatures, EMPTY_FORMAT, EMPTY_INCLUDE`

### Constructor Summary

Constructors
`` `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, ContextAttributes attrs)`
`protected` `DeserializationConfig(DeserializationConfig src, DatatypeFeatures datatypeFeatures)`
`protected` `DeserializationConfig(DeserializationConfig src, SimpleMixInResolver mixins)`
`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`.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected DeserializationConfig` `_with(DatatypeFeatures dtFeatures)`
`protected DeserializationConfig` `_withBase(BaseSettings newBase)`
`protected DeserializationConfig` `_withMapperFeatures(long mapperFeatures)`
`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.
`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).
`TypeDeserializer` `findTypeDeserializer(JavaType baseType)` Helper method that is needed to properly handle polymorphic referenced types, such as types referenced by `AtomicReference`, or various "optional" types.
`protected BaseSettings` `getBaseSettings()`
`ConstructorDetector` `getConstructorDetector()`
`int` `getDeserializationFeatures()` Bulk access method for getting the bit mask of all `DeserializationFeature`s that are enabled.
`JsonNodeFactory` `getNodeFactory()`
`LinkedNode<DeserializationProblemHandler>` `getProblemHandlers()` Method for getting head of the problem handler chain.
`boolean` `hasDeserializationFeatures(int featureMask)` Bulk access method for checking that all features specified by mask are enabled.
`boolean` `hasSomeOfFeatures(int featureMask)` Bulk access method for checking that at least one of features specified by mask is enabled.
`JsonParser` `initialize(JsonParser p)` Method called by `ObjectMapper` and `ObjectReader` to modify those `JsonParser.Feature` settings that have been configured via this config instance.
`JsonParser` `initialize(JsonParser p, FormatSchema schema)`
`BeanDescription` `introspect(JavaType type)` Method that will introspect full bean properties for the purpose of building a bean deserializer
`BeanDescription` `introspectForBuilder(JavaType builderType, BeanDescription valueTypeDesc)`
`BeanDescription` `introspectForCreation(JavaType type)` Method that will introspect subset of bean properties needed to construct bean instance.
`boolean` `isEnabled(DatatypeFeature feature)` Accessor for checking whether give `DatatypeFeature` is enabled or not.
`boolean` `isEnabled(DeserializationFeature feature)` Accessor for checking whether give `DeserializationFeature` is enabled or not.
`boolean` `isEnabled(JsonParser.Feature f, JsonFactory factory)`
`boolean` `requiresFullValue()` Convenience method equivalent to: `isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)`
`boolean` `useRootWrapping()` Accessor for checking whether configuration indicates that "root wrapping" (use of an extra property/name pair at root level) is expected or not.
`DeserializationConfig` `with(ConstructorDetector ctorDetector)`
`DeserializationConfig` `with(ContextAttributes attrs)` Method for constructing an instance that has specified contextual attributes.
`DeserializationConfig` `with(DeserializationFeature feature)` Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
`DeserializationConfig` `with(DeserializationFeature first, DeserializationFeature... features)` Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
`DeserializationConfig` `with(FormatFeature feature)` Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
`DeserializationConfig` `with(JsonNodeFactory f)` Fluent factory method that will construct a new instance with specified `JsonNodeFactory`
`DeserializationConfig` `with(JsonParser.Feature feature)` Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
`DeserializationConfig` `with(SubtypeResolver str)` Method for constructing and returning a new instance with different `SubtypeResolver` to use.
`DeserializationConfig` `withFeatures(DeserializationFeature... features)` Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
`DeserializationConfig` `withFeatures(FormatFeature... features)` Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
`DeserializationConfig` `withFeatures(JsonParser.Feature... features)` Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
`DeserializationConfig` `withHandler(DeserializationProblemHandler h)` Method that can be used to add a handler that can (try to) resolve non-fatal deserialization problems.
`DeserializationConfig` `withNoProblemHandlers()` Method for removing all configured problem handlers; usually done to replace existing handler(s) with different one(s)
`DeserializationConfig` `without(DeserializationFeature feature)` Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.
`DeserializationConfig` `without(DeserializationFeature first, DeserializationFeature... features)` Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
`DeserializationConfig` `without(FormatFeature feature)` Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.
`DeserializationConfig` `without(JsonParser.Feature feature)` Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.
`DeserializationConfig` `withoutFeatures(DeserializationFeature... features)` Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
`DeserializationConfig` `withoutFeatures(FormatFeature... features)` Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
`DeserializationConfig` `withoutFeatures(JsonParser.Feature... features)` Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
`DeserializationConfig` `withRootName(PropertyName rootName)` Method for constructing and returning a new instance with different root name to use (none, if null).
`DeserializationConfig` `withView(Class<?> view)` Method for constructing and returning a new instance with different view to use.

### Methods inherited from class com.fasterxml.jackson.databind.cfg.MapperConfigBase

`_datatypeFeatures, copy, findConfigOverride, findMixInClassFor, findRootName, findRootName, getActiveView, getAttributes, getConfigOverride, getDatatypeFeatures, getDefaultInclusion, getDefaultMergeable, getDefaultMergeable, getDefaultPropertyFormat, getDefaultPropertyIgnorals, getDefaultPropertyIgnorals, getDefaultPropertyInclusion, getDefaultPropertyInclusion, getDefaultPropertyInclusions, getDefaultSetterInfo, getDefaultVisibilityChecker, getDefaultVisibilityChecker, getFullRootName, getRootName, getSubtypeResolver, mixInCount, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, withAppendedAnnotationIntrospector, withAttribute, withAttributes, withFeatures, withInsertedAnnotationIntrospector, without, without, withoutAttribute, withoutFeatures, withRootName`

### Methods inherited from class com.fasterxml.jackson.databind.cfg.MapperConfig

`canOverrideAccessModifiers, collectFeatureDefaults, compileString, constructSpecializedType, constructType, constructType, getAccessorNaming, getAnnotationIntrospector, getBase64Variant, getCacheProvider, getClassIntrospector, getDateFormat, getDefaultInclusion, getDefaultPropertyInclusion, getDefaultTyper, getEnumNamingStrategy, getHandlerInstantiator, getLocale, getPolymorphicTypeValidator, getPropertyNamingStrategy, getTimeZone, getTypeFactory, hasExplicitTimeZone, hasMapperFeatures, introspectClassAnnotations, introspectClassAnnotations, introspectDirectClassAnnotations, introspectDirectClassAnnotations, isAnnotationProcessingEnabled, isEnabled, shouldSortPropertiesAlphabetically, typeIdResolverInstance, typeResolverBuilderInstance`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _problemHandlers

    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.

#### _nodeFactory

    protected final JsonNodeFactory _nodeFactory

Factory used for constructing `JsonNode` instances.

#### _coercionConfigs

    protected final CoercionConfigs _coercionConfigs

Since:
  2.12

#### _ctorDetector

    protected final ConstructorDetector _ctorDetector

Since:
  2.12

#### _deserFeatures

    protected final int _deserFeatures

Set of `DeserializationFeature`s enabled.

#### _parserFeatures

    protected final int _parserFeatures

States of `JsonParser.Feature`s to enable/disable.

#### _parserFeaturesToChange

    protected final int _parserFeaturesToChange

Bitflag of `JsonParser.Feature`s to enable/disable

#### _formatReadFeatures

    protected final int _formatReadFeatures

States of `FormatFeature`s to enable/disable.

Since:
  2.7

#### _formatReadFeaturesToChange

    protected final int _formatReadFeaturesToChange

Bitflag of `FormatFeature`s to enable/disable

Since:
  2.7

### Constructor Detail

#### DeserializationConfig

    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

#### DeserializationConfig

    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

#### DeserializationConfig

    protected DeserializationConfig(DeserializationConfig src,
                                    ContextAttributes attrs)

#### DeserializationConfig

    protected DeserializationConfig(DeserializationConfig src,
                                    SimpleMixInResolver mixins)

#### DeserializationConfig

    protected DeserializationConfig(DeserializationConfig src,
                                    DatatypeFeatures datatypeFeatures)

Since:
  2.14

### Method Detail

#### getBaseSettings

    protected BaseSettings getBaseSettings()

#### _withBase

    protected final DeserializationConfig _withBase(BaseSettings newBase)

Specified by:
  `_withBase` in class `MapperConfigBase<DeserializationFeature,DeserializationConfig>`

#### _withMapperFeatures

    protected final DeserializationConfig _withMapperFeatures(long mapperFeatures)

Specified by:
  `_withMapperFeatures` in class `MapperConfigBase<DeserializationFeature,DeserializationConfig>`

#### _with

    protected final DeserializationConfig _with(DatatypeFeatures dtFeatures)

Specified by:
  `_with` in class `MapperConfigBase<DeserializationFeature,DeserializationConfig>`

#### with

    public DeserializationConfig with(SubtypeResolver str)

Description copied from class: `MapperConfigBase`
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.

Specified by:
  `with` in class `MapperConfigBase<DeserializationFeature,DeserializationConfig>`

#### withRootName

    public DeserializationConfig withRootName(PropertyName rootName)

Description copied from class: `MapperConfigBase`
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.

Specified by:
  `withRootName` in class `MapperConfigBase<DeserializationFeature,DeserializationConfig>`
Parameters:
  `rootName` - 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.

#### withView

    public DeserializationConfig withView(Class<?> view)

Description copied from class: `MapperConfigBase`
Method for constructing and returning a new instance with different view to use.

Specified by:
  `withView` in class `MapperConfigBase<DeserializationFeature,DeserializationConfig>`

#### with

    public DeserializationConfig with(ContextAttributes attrs)

Description copied from class: `MapperConfigBase`
Method for constructing an instance that has specified contextual attributes.

Specified by:
  `with` in class `MapperConfigBase<DeserializationFeature,DeserializationConfig>`

#### with

    public DeserializationConfig with(DeserializationFeature feature)

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

#### with

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

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

#### withFeatures

    public DeserializationConfig withFeatures(DeserializationFeature... features)

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

#### without

    public DeserializationConfig without(DeserializationFeature feature)

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

#### without

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

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

#### withoutFeatures

    public DeserializationConfig withoutFeatures(DeserializationFeature... features)

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

#### with

    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

#### withFeatures

    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

#### without

    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

#### withoutFeatures

    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

#### with

    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

#### withFeatures

    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

#### without

    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

#### withoutFeatures

    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

#### with

    public DeserializationConfig with(JsonNodeFactory f)

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

#### with

    public DeserializationConfig with(ConstructorDetector ctorDetector)

Since:
  2.12

#### withHandler

    public DeserializationConfig withHandler(DeserializationProblemHandler h)

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

#### withNoProblemHandlers

    public DeserializationConfig withNoProblemHandlers()

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

#### initialize

    public JsonParser initialize(JsonParser p)

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

Since:
  2.5

#### initialize

    public JsonParser initialize(JsonParser p,
                                 FormatSchema schema)

Since:
  2.12

#### useRootWrapping

    public boolean useRootWrapping()

Description copied from class: `MapperConfig`
Accessor for checking whether configuration indicates that "root wrapping" (use of an extra property/name pair at root level) is expected or not.

Specified by:
  `useRootWrapping` in class `MapperConfig<DeserializationConfig>`

#### isEnabled

    public final boolean isEnabled(DeserializationFeature feature)

Accessor for checking whether give `DeserializationFeature` is enabled or not.

Parameters:
  `feature` - Feature to check
Returns:
  True if feature is enabled; false otherwise

#### isEnabled

    public final boolean isEnabled(JsonParser.Feature f,
                                   JsonFactory factory)

#### hasDeserializationFeatures

    public final boolean hasDeserializationFeatures(int featureMask)

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

Since:
  2.3

#### hasSomeOfFeatures

    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

#### getDeserializationFeatures

    public final int getDeserializationFeatures()

Bulk access method for getting the bit mask of all `DeserializationFeature`s that are enabled.

#### requiresFullValue

    public final boolean requiresFullValue()

Convenience method equivalent to: `isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)`

Since:
  2.9

#### isEnabled

    public final boolean isEnabled(DatatypeFeature feature)

Accessor for checking whether give `DatatypeFeature` is enabled or not.

Specified by:
  `isEnabled` in class `MapperConfig<DeserializationConfig>`
Parameters:
  `feature` - Feature to check
Returns:
  True if feature is enabled; false otherwise
Since:
  2.14

#### getProblemHandlers

    public LinkedNode<DeserializationProblemHandler> getProblemHandlers()

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

#### getNodeFactory

    public final JsonNodeFactory getNodeFactory()

#### getConstructorDetector

    public ConstructorDetector getConstructorDetector()

Specified by:
  `getConstructorDetector` in class `MapperConfig<DeserializationConfig>`
Since:
  2.12

#### introspect

    public BeanDescription introspect(JavaType type)

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

Parameters:
  `type` - Type of class to be introspected

#### introspectForCreation

    public BeanDescription introspectForCreation(JavaType type)

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

#### introspectForBuilder

    public BeanDescription introspectForBuilder(JavaType builderType,
                                                BeanDescription valueTypeDesc)

Since:
  2.12

#### findTypeDeserializer

    public TypeDeserializer findTypeDeserializer(JavaType baseType)
                                          throws JsonMappingException

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

Throws:
  `JsonMappingException`
Since:
  2.4

#### findCoercionAction

    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` - Logical target type of coercion
  `targetClass` - Physical target type of coercion
  `inputShape` - Input shape to coerce from
Returns:
  CoercionAction configured for specific coercion
Since:
  2.12

#### findCoercionFromBlankString

    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` - Logical target type of coercion
  `targetClass` - Physical target type of coercion
  `actionIfBlankNotAllowed` - Return value to use in case "blanks as empty" is not allowed
Returns:
  CoercionAction configured for specified coercion from blank string
Since:
  2.12