java.lang.Object
tools.jackson.databind.cfg.MapperConfig<T>
tools.jackson.databind.cfg.MapperConfigBase<DeserializationFeature,DeserializationConfig>
tools.jackson.databind.DeserializationConfig
- All Implemented Interfaces:
Serializable
,Snapshottable<MixInResolver>
,MixInResolver
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AbstractTypeResolver[]
List of objects that may be able to resolve abstract types to concrete types.protected final CoercionConfigs
Configured coercion rules for coercions from secondary input shapes.protected final int
Set ofDeserializationFeature
s enabled.protected final int
States ofFormatFeature
s to enable/disable.protected final LinkedNode<DeserializationProblemHandler>
Linked list that contains all registered problem handlers.protected final int
States ofStreamReadFeature
s to enable/disable.Fields inherited from class tools.jackson.databind.cfg.MapperConfigBase
_attributes, _classIntrospector, _configOverrides, _datatypeFeatures, _mixIns, _rootName, _rootNames, _subtypeResolver, _typeFactory, _typeResolverProvider, _view, EMPTY_OVERRIDE
Fields inherited from class tools.jackson.databind.cfg.MapperConfig
_base, _mapperFeatures, EMPTY_FORMAT, EMPTY_INCLUDE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDeserializationConfig
(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) protected
protected
DeserializationConfig
(DeserializationConfig src, DatatypeFeatures dtFeatures) -
Method Summary
Modifier and TypeMethodDescriptionprotected final DeserializationConfig
_with
(DatatypeFeatures dtFeatures) protected final DeserializationConfig
_withBase
(BaseSettings newBase) 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.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).protected BaseSettings
final int
Bulk access method for getting the bit mask of allDeserializationFeature
s that are enabled.int
Method for getting head of the problem handler chain.int
boolean
final boolean
hasDeserializationFeatures
(int featureMask) Bulk access method for checking that all features specified by mask are enabled.final boolean
final boolean
hasSomeOfFeatures
(int featureMask) Bulk access method for checking that at least one of features specified by mask is enabled.final boolean
final boolean
mapAbstractType
(JavaType type) final boolean
Convenience method equivalent to:isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)
boolean
Accessor for checking whether configuration indicates that "root wrapping" (use of an extra property/name pair at root level) is expected or not.with
(FormatFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified features enabled.with
(StreamReadFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified features enabled.with
(ContextAttributes attrs) Method for constructing an instance that has specified contextual attributes.with
(DeserializationFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified features enabled.with
(DeserializationFeature first, DeserializationFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features enabled.withFeatures
(FormatFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features enabled.withFeatures
(StreamReadFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features enabled.withFeatures
(DeserializationFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features enabled.Method that can be used to add a handler that can (try to) resolve non-fatal deserialization problems.Method for removing all configured problem handlers; usually done to replace existing handler(s) with different one(s)without
(FormatFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.without
(StreamReadFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.without
(DeserializationFeature feature) Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.without
(DeserializationFeature first, DeserializationFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features disabled.withoutFeatures
(FormatFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features disabled.withoutFeatures
(StreamReadFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features disabled.withoutFeatures
(DeserializationFeature... features) Fluent factory method that will construct and return a new configuration object instance with specified features disabled.withRootName
(PropertyName rootName) Method for constructing and returning a new instance with different root name to use (none, if null).Method for constructing and returning a new instance with different view to use.Methods inherited from class tools.jackson.databind.cfg.MapperConfigBase
_datatypeFeatures, classIntrospectorInstance, constructType, constructType, findConfigOverride, findMixInClassFor, findRootName, findRootName, getActiveView, getAttributes, getConfigOverride, getDatatypeFeatures, getDefaultInclusion, getDefaultMergeable, getDefaultMergeable, getDefaultNullHandling, getDefaultPropertyFormat, getDefaultPropertyIgnorals, getDefaultPropertyIgnorals, getDefaultPropertyInclusion, getDefaultPropertyInclusion, getDefaultPropertyInclusions, getDefaultVisibilityChecker, getDefaultVisibilityChecker, getFullRootName, getSubtypeResolver, getTypeFactory, getTypeResolverProvider, hasMixIns, isEnabled, mixInCount, snapshot, with, with, with, with, with, with, with, with, with, withAttribute, withAttributes, withFeatures, without, withoutAttribute, withoutFeatures, withRootName
Methods inherited from class tools.jackson.databind.cfg.MapperConfig
canOverrideAccessModifiers, compileString, getAccessorNaming, getAnnotationIntrospector, getBase64Variant, getCacheProvider, getConstructorDetector, getDateFormat, getDefaultInclusion, getDefaultPropertyInclusion, getDefaultTyper, getEnumNamingStrategy, getHandlerInstantiator, getLocale, getNodeFactory, getPolymorphicTypeValidator, getPropertyNamingStrategy, getTimeZone, hasExplicitTimeZone, isAnnotationProcessingEnabled, isEnabled, shouldSortPropertiesAlphabetically, typeIdResolverInstance, typeResolverBuilderInstance
-
Field Details
-
_deserFeatures
protected final int _deserFeaturesSet ofDeserializationFeature
s enabled. -
_streamReadFeatures
protected final int _streamReadFeaturesStates ofStreamReadFeature
s to enable/disable. -
_formatReadFeatures
protected final int _formatReadFeaturesStates ofFormatFeature
s to enable/disable. -
_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. -
_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. -
_coercionConfigs
Configured coercion rules for coercions from secondary input shapes.
-
-
Constructor Details
-
DeserializationConfig
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
-
DeserializationConfig
-
DeserializationConfig
-
-
Method Details
-
getBaseSettings
-
_withBase
- Specified by:
_withBase
in classMapperConfigBase<DeserializationFeature,
DeserializationConfig>
-
_with
- Specified by:
_with
in classMapperConfigBase<DeserializationFeature,
DeserializationConfig>
-
withRootName
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 classMapperConfigBase<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
Description copied from class:MapperConfigBase
Method for constructing and returning a new instance with different view to use.- Specified by:
withView
in classMapperConfigBase<DeserializationFeature,
DeserializationConfig>
-
with
Description copied from class:MapperConfigBase
Method for constructing an instance that has specified contextual attributes.- Specified by:
with
in classMapperConfigBase<DeserializationFeature,
DeserializationConfig>
-
with
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. -
with
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. -
withFeatures
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. -
without
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
Fluent factory method that will construct and return a new configuration object instance with specified features disabled. -
with
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. -
withFeatures
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. -
without
Fluent factory method that will construct and return a new configuration object instance with specified feature disabled. -
withoutFeatures
Fluent factory method that will construct and return a new configuration object instance with specified features disabled. -
with
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. -
withFeatures
Fluent factory method that will construct and return a new configuration object instance with specified features enabled. -
without
Fluent factory method that will construct and return a new configuration object instance with specified feature disabled. -
withoutFeatures
Fluent factory method that will construct and return a new configuration object instance with specified features disabled. -
withHandler
Method that can be used to add a handler that can (try to) resolve non-fatal deserialization problems. -
withNoProblemHandlers
Method for removing all configured problem handlers; usually done to replace existing handler(s) with different one(s) -
getStreamReadFeatures
public int getStreamReadFeatures()- Since:
- 3.0
-
getFormatReadFeatures
public int getFormatReadFeatures()- Since:
- 3.0
-
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 classMapperConfig<DeserializationConfig>
-
isEnabled
-
isEnabled
-
hasFormatFeature
-
hasDeserializationFeatures
public final boolean hasDeserializationFeatures(int featureMask) Bulk access method for checking that all features specified by mask are enabled. -
hasSomeOfFeatures
public final boolean hasSomeOfFeatures(int featureMask) Bulk access method for checking that at least one of features specified by mask is enabled. -
getDeserializationFeatures
public final int getDeserializationFeatures()Bulk access method for getting the bit mask of allDeserializationFeature
s that are enabled. -
requiresFullValue
public final boolean requiresFullValue()Convenience method equivalent to:isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)
-
hasAbstractTypeResolvers
public boolean hasAbstractTypeResolvers()- Since:
- 3.0
-
abstractTypeResolvers
- Since:
- 3.0
-
mapAbstractType
- Since:
- 3.0
-
getProblemHandlers
Method for getting head of the problem handler chain. May be null, if no handlers have been added. -
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 coerciontargetClass
- Physical target type of coercioninputShape
- 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, returnsactionIfBlankNotAllowed
, otherwise returns action forCoercionInputShape.EmptyString
.- Parameters:
targetType
- Logical target type of coerciontargetClass
- Physical target type of coercionactionIfBlankNotAllowed
- Return value to use in case "blanks as empty" is not allowed- Returns:
- CoercionAction configured for specified coercion from blank string
- Since:
- 2.12
-