public final class DeserializationConfig extends MapperConfigBase<DeserializationFeature,DeserializationConfig> implements Serializable
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.
Modifier and Type | Field and Description |
---|---|
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.
|
_attributes, _configOverrides, _mixIns, _rootName, _rootNames, _subtypeResolver, _view
_base, _mapperFeatures, EMPTY_FORMAT, EMPTY_INCLUDE
Modifier | Constructor and Description |
---|---|
|
DeserializationConfig(BaseSettings base,
SubtypeResolver str,
SimpleMixInResolver mixins,
RootNameLookup rootNames)
Deprecated.
Since 2.8, remove from 2.9 or later
|
|
DeserializationConfig(BaseSettings base,
SubtypeResolver str,
SimpleMixInResolver mixins,
RootNameLookup rootNames,
ConfigOverrides configOverrides)
Constructor used by ObjectMapper to create default configuration object instance.
|
protected |
DeserializationConfig(DeserializationConfig src,
ContextAttributes attrs) |
protected |
DeserializationConfig(DeserializationConfig src,
SimpleMixInResolver mixins) |
protected |
DeserializationConfig(DeserializationConfig src,
SimpleMixInResolver mixins,
RootNameLookup rootNames,
ConfigOverrides configOverrides)
Copy-constructor used for making a copy used by new
ObjectMapper . |
Modifier and Type | Method and Description |
---|---|
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. |
AnnotationIntrospector |
getAnnotationIntrospector()
Method for getting
AnnotationIntrospector configured
to introspect annotation values used for configuration. |
protected BaseSettings |
getBaseSettings() |
JsonInclude.Value |
getDefaultPropertyInclusion()
Accessor for default property inclusion to use for serialization,
used unless overridden by per-type or per-property overrides.
|
JsonInclude.Value |
getDefaultPropertyInclusion(Class<?> baseType)
Accessor for default property inclusion to use for serialization,
considering possible per-type override for given base type.
NOTE: if no override found, defaults to value returned by MapperConfig.getDefaultPropertyInclusion() . |
JsonInclude.Value |
getDefaultPropertyInclusion(Class<?> baseType,
JsonInclude.Value defaultIncl)
Accessor for default property inclusion to use for serialization,
considering possible per-type override for given base type; but
if none found, returning given
defaultIncl |
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.
|
void |
initialize(JsonParser p)
Method called by
ObjectMapper and ObjectReader
to modify those JsonParser.Feature settings
that have been configured via this config instance. |
<T extends BeanDescription> |
introspect(JavaType type)
Method that will introspect full bean properties for the purpose
of building a bean deserializer
|
BeanDescription |
introspectClassAnnotations(JavaType type)
Accessor for getting bean description that only contains class
annotations: useful if no getter/setter/creator information is needed.
|
BeanDescription |
introspectDirectClassAnnotations(JavaType type)
Accessor for getting bean description that only contains immediate class
annotations: ones from the class, and its direct mix-in, if any, but
not from super types.
|
<T extends BeanDescription> |
introspectForBuilder(JavaType type) |
<T extends BeanDescription> |
introspectForCreation(JavaType type)
Method that will introspect subset of bean properties needed to
construct bean instance.
|
boolean |
isEnabled(DeserializationFeature f) |
boolean |
isEnabled(JsonParser.Feature f,
JsonFactory factory) |
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(AnnotationIntrospector ai)
Method for constructing and returning a new instance with different
AnnotationIntrospector to use (replacing old one). |
DeserializationConfig |
with(Base64Variant base64)
Method for constructing and returning a new instance with different
default
Base64Variant to use with base64-encoded binary values. |
DeserializationConfig |
with(ClassIntrospector ci)
Method for constructing and returning a new instance with different
ClassIntrospector
to use. |
DeserializationConfig |
with(ContextAttributes attrs)
Method for constructing an instance that has specified
contextual attributes.
|
DeserializationConfig |
with(DateFormat df)
Method for constructing and returning a new instance with different
DateFormat
to use. |
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(HandlerInstantiator hi)
Method for constructing and returning a new instance with different
HandlerInstantiator
to use. |
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(Locale l)
Method for constructing and returning a new instance with different
default
Locale to use for formatting. |
DeserializationConfig |
with(MapperFeature... features)
Method for constructing and returning a new instance with specified
mapper features enabled.
|
DeserializationConfig |
with(MapperFeature feature,
boolean state) |
DeserializationConfig |
with(PropertyNamingStrategy pns)
Method for constructing and returning a new instance with different
PropertyNamingStrategy
to use. |
DeserializationConfig |
with(SubtypeResolver str)
Method for constructing and returning a new instance with different
SubtypeResolver
to use. |
DeserializationConfig |
with(TimeZone tz)
Method for constructing and returning a new instance with different
default
TimeZone to use for formatting of date values. |
DeserializationConfig |
with(TypeFactory tf)
Method for constructing and returning a new instance with different
TypeFactory
to use. |
DeserializationConfig |
with(TypeResolverBuilder<?> trb)
Method for constructing and returning a new instance with different
TypeResolverBuilder to use. |
DeserializationConfig |
with(VisibilityChecker<?> vc)
Method for constructing and returning a new instance with different
VisibilityChecker
to use. |
DeserializationConfig |
withAppendedAnnotationIntrospector(AnnotationIntrospector ai)
Method for constructing and returning a new instance with additional
AnnotationIntrospector appended (as the lowest priority one) |
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 |
withInsertedAnnotationIntrospector(AnnotationIntrospector ai)
Method for constructing and returning a new instance with additional
AnnotationIntrospector inserted (as the highest priority one) |
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 |
without(MapperFeature... features)
Method for constructing and returning a new instance with specified
mapper features 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.
|
DeserializationConfig |
withVisibility(PropertyAccessor forMethod,
JsonAutoDetect.Visibility visibility)
Method for constructing and returning a new instance with different
minimal visibility level for specified property type
|
copy, findConfigOverride, findMixInClassFor, findRootName, findRootName, getActiveView, getAttributes, getDefaultPropertyFormat, getDefaultPropertyIgnorals, getDefaultPropertyIgnorals, getDefaultVisibilityChecker, getFullRootName, getRootName, getSubtypeResolver, mixInCount, withAttribute, withAttributes, withoutAttribute, withRootName
canOverrideAccessModifiers, collectFeatureDefaults, compileString, constructSpecializedType, constructType, constructType, getBase64Variant, getClassIntrospector, getDateFormat, getDefaultTyper, getHandlerInstantiator, getLocale, getPropertyNamingStrategy, getTimeZone, getTypeFactory, hasMapperFeatures, introspectClassAnnotations, introspectDirectClassAnnotations, isAnnotationProcessingEnabled, isEnabled, shouldSortPropertiesAlphabetically, typeIdResolverInstance, typeResolverBuilderInstance
protected final LinkedNode<DeserializationProblemHandler> _problemHandlers
protected final JsonNodeFactory _nodeFactory
JsonNode
instances.protected final int _deserFeatures
DeserializationFeature
s enabled.protected final int _parserFeatures
JsonParser.Feature
s to enable/disable.protected final int _parserFeaturesToChange
JsonParser.Feature
s to enable/disableprotected final int _formatReadFeatures
FormatFeature
s to enable/disable.protected final int _formatReadFeaturesToChange
FormatFeature
s to enable/disablepublic DeserializationConfig(BaseSettings base, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides)
@Deprecated public DeserializationConfig(BaseSettings base, SubtypeResolver str, SimpleMixInResolver mixins, RootNameLookup rootNames)
protected DeserializationConfig(DeserializationConfig src, ContextAttributes attrs)
protected DeserializationConfig(DeserializationConfig src, SimpleMixInResolver mixins)
protected DeserializationConfig(DeserializationConfig src, SimpleMixInResolver mixins, RootNameLookup rootNames, ConfigOverrides configOverrides)
ObjectMapper
.protected BaseSettings getBaseSettings()
public DeserializationConfig with(MapperFeature... features)
MapperConfig
with
in class MapperConfig<DeserializationConfig>
public DeserializationConfig without(MapperFeature... features)
MapperConfig
without
in class MapperConfig<DeserializationConfig>
public DeserializationConfig with(MapperFeature feature, boolean state)
with
in class MapperConfig<DeserializationConfig>
public DeserializationConfig with(ClassIntrospector ci)
MapperConfigBase
ClassIntrospector
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(AnnotationIntrospector ai)
MapperConfigBase
AnnotationIntrospector
to use (replacing old one).
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(VisibilityChecker<?> vc)
MapperConfigBase
VisibilityChecker
to use.with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig withVisibility(PropertyAccessor forMethod, JsonAutoDetect.Visibility visibility)
MapperConfigBase
withVisibility
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(TypeResolverBuilder<?> trb)
MapperConfigBase
TypeResolverBuilder
to use.with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(SubtypeResolver str)
MapperConfigBase
SubtypeResolver
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(PropertyNamingStrategy pns)
MapperConfigBase
PropertyNamingStrategy
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig withRootName(PropertyName rootName)
MapperConfigBase
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.
withRootName
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
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.public DeserializationConfig with(TypeFactory tf)
MapperConfigBase
TypeFactory
to use.with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(DateFormat df)
MapperConfigBase
DateFormat
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(HandlerInstantiator hi)
MapperConfigBase
HandlerInstantiator
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig withInsertedAnnotationIntrospector(AnnotationIntrospector ai)
MapperConfigBase
AnnotationIntrospector
inserted (as the highest priority one)withInsertedAnnotationIntrospector
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig withAppendedAnnotationIntrospector(AnnotationIntrospector ai)
MapperConfigBase
AnnotationIntrospector
appended (as the lowest priority one)withAppendedAnnotationIntrospector
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig withView(Class<?> view)
MapperConfigBase
withView
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(Locale l)
MapperConfigBase
Locale
to use for formatting.with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(TimeZone tz)
MapperConfigBase
TimeZone
to use for formatting of date values.with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(Base64Variant base64)
MapperConfigBase
Base64Variant
to use with base64-encoded binary values.with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(ContextAttributes attrs)
MapperConfigBase
with
in class MapperConfigBase<DeserializationFeature,DeserializationConfig>
public DeserializationConfig with(DeserializationFeature feature)
public DeserializationConfig with(DeserializationFeature first, DeserializationFeature... features)
public DeserializationConfig withFeatures(DeserializationFeature... features)
public DeserializationConfig without(DeserializationFeature feature)
public DeserializationConfig without(DeserializationFeature first, DeserializationFeature... features)
public DeserializationConfig withoutFeatures(DeserializationFeature... features)
public DeserializationConfig with(JsonParser.Feature feature)
public DeserializationConfig withFeatures(JsonParser.Feature... features)
public DeserializationConfig without(JsonParser.Feature feature)
public DeserializationConfig withoutFeatures(JsonParser.Feature... features)
public DeserializationConfig with(FormatFeature feature)
public DeserializationConfig withFeatures(FormatFeature... features)
public DeserializationConfig without(FormatFeature feature)
public DeserializationConfig withoutFeatures(FormatFeature... features)
public DeserializationConfig with(JsonNodeFactory f)
JsonNodeFactory
public DeserializationConfig withHandler(DeserializationProblemHandler h)
public DeserializationConfig withNoProblemHandlers()
public void initialize(JsonParser p)
ObjectMapper
and ObjectReader
to modify those JsonParser.Feature
settings
that have been configured via this config instance.public AnnotationIntrospector getAnnotationIntrospector()
AnnotationIntrospector
configured
to introspect annotation values used for configuration.getAnnotationIntrospector
in class MapperConfig<DeserializationConfig>
public BeanDescription introspectClassAnnotations(JavaType type)
introspectClassAnnotations
in class MapperConfig<DeserializationConfig>
public BeanDescription introspectDirectClassAnnotations(JavaType type)
introspectDirectClassAnnotations
in class MapperConfig<DeserializationConfig>
public JsonInclude.Value getDefaultPropertyInclusion()
MapperConfig
getDefaultPropertyInclusion
in class MapperConfig<DeserializationConfig>
public JsonInclude.Value getDefaultPropertyInclusion(Class<?> baseType)
MapperConfig
MapperConfig.getDefaultPropertyInclusion()
.getDefaultPropertyInclusion
in class MapperConfig<DeserializationConfig>
public JsonInclude.Value getDefaultPropertyInclusion(Class<?> baseType, JsonInclude.Value defaultIncl)
MapperConfig
defaultIncl
getDefaultPropertyInclusion
in class MapperConfig<DeserializationConfig>
defaultIncl
- Inclusion setting to return if no overrides found.public boolean useRootWrapping()
MapperConfig
useRootWrapping
in class MapperConfig<DeserializationConfig>
public final boolean isEnabled(DeserializationFeature f)
public final boolean isEnabled(JsonParser.Feature f, JsonFactory factory)
public final boolean hasDeserializationFeatures(int featureMask)
public final boolean hasSomeOfFeatures(int featureMask)
public final int getDeserializationFeatures()
DeserializationFeature
s
that are enabled.public LinkedNode<DeserializationProblemHandler> getProblemHandlers()
public final JsonNodeFactory getNodeFactory()
public <T extends BeanDescription> T introspect(JavaType type)
type
- Type of class to be introspectedpublic <T extends BeanDescription> T introspectForCreation(JavaType type)
public <T extends BeanDescription> T introspectForBuilder(JavaType type)
public TypeDeserializer findTypeDeserializer(JavaType baseType) throws JsonMappingException
AtomicReference
,
or various "optional" types.JsonMappingException
Copyright © 2017 JBoss by Red Hat. All rights reserved.