public class DeserializationConfig extends MapperConfig<T>
ObjectMapper
, which makes
a copy that is passed during serialization process to
DeserializerProvider
and DeserializerFactory
.
Note: although configuration settings can be changed at any time (for factories and instances), they are not guaranteed to have effect if called after constructing relevant mapper or deserializer instance. This because some objects may be configured, constructed and cached first time they are needed.
As of version 1.9, the goal is to make this class eventually immutable. Because of this, existing methods that allow changing state of this instance are deprecated in favor of methods that create new instances with different configuration ("fluent factories")
Modifier and Type | Class and Description |
---|---|
static class |
DeserializationConfig.Feature
Enumeration that defines togglable features that guide
the serialization feature.
|
MapperConfig.Base, MapperConfig.ConfigFeature
Modifier and Type | Field and Description |
---|---|
protected int |
_featureFlags
Note: moved to base class in 1.9; was stored by sub-class earlier
|
protected JsonNodeFactory |
_nodeFactory
Factory used for constructing
JsonNode instances. |
protected LinkedNode<DeserializationProblemHandler> |
_problemHandlers
Linked list that contains all registered problem handlers.
|
protected boolean |
_sortPropertiesAlphabetically
Feature flag from
SerializationConfig which is needed to
know if serializer will by default sort properties in
alphabetic order. |
_base, _mixInAnnotations, _mixInAnnotationsShared, _subtypeResolver, DEFAULT_DATE_FORMAT
Modifier | Constructor and Description |
---|---|
|
DeserializationConfig(ClassIntrospector<? extends BeanDescription> intr,
AnnotationIntrospector annIntr,
VisibilityChecker<?> vc,
SubtypeResolver subtypeResolver,
PropertyNamingStrategy propertyNamingStrategy,
TypeFactory typeFactory,
HandlerInstantiator handlerInstantiator)
Constructor used by ObjectMapper to create default configuration object instance.
|
protected |
DeserializationConfig(DeserializationConfig src) |
protected |
DeserializationConfig(DeserializationConfig src,
int featureFlags) |
protected |
DeserializationConfig(DeserializationConfig src,
JsonNodeFactory f) |
protected |
DeserializationConfig(DeserializationConfig src,
MapperConfig.Base base) |
Modifier and Type | Method and Description |
---|---|
void |
addHandler(DeserializationProblemHandler h)
Method that can be used to add a handler that can (try to)
resolve non-fatal deserialization problems.
|
boolean |
canOverrideAccessModifiers()
Accessor for determining whether it is ok to try to force override of access
modifiers to be able to get or set values of non-public Methods, Fields;
to invoke non-public Constructors, Methods; or to instantiate non-public
Classes.
|
void |
clearHandlers()
Method for removing all configured problem handlers; usually done to replace
existing handler(s) with different one(s)
|
DeserializationConfig |
createUnshared(SubtypeResolver subtypeResolver)
Method that is called to create a non-shared copy of the configuration
to be used for a deserialization operation.
|
JsonDeserializer<Object> |
deserializerInstance(Annotated annotated,
Class<? extends JsonDeserializer<?>> deserClass) |
void |
disable(DeserializationConfig.Feature f)
Deprecated.
Since 1.9, it is preferable to use
without(org.codehaus.jackson.map.DeserializationConfig.Feature...) instead;
this method is deprecated as it modifies current instance instead of
creating a new one (as the goal is to make this class immutable) |
void |
enable(DeserializationConfig.Feature f)
Deprecated.
Since 1.9, it is preferable to use
with(org.codehaus.jackson.map.DeserializationConfig.Feature...) instead;
this method is deprecated as it modifies current instance instead of
creating a new one (as the goal is to make this class immutable) |
void |
fromAnnotations(Class<?> cls)
Deprecated.
Since 1.9, it is preferably to explicitly configure
instances; this method also modifies existing instance which is
against immutable design goals of this class.
|
AnnotationIntrospector |
getAnnotationIntrospector()
Method for getting
AnnotationIntrospector configured
to introspect annotation values used for configuration. |
Base64Variant |
getBase64Variant()
Method called during deserialization if Base64 encoded content
needs to be decoded.
|
VisibilityChecker<?> |
getDefaultVisibilityChecker()
Accessor for object used for determining whether specific property elements
(method, constructors, fields) can be auto-detected based on
their visibility (access modifiers).
|
JsonNodeFactory |
getNodeFactory() |
LinkedNode<DeserializationProblemHandler> |
getProblemHandlers()
Method for getting head of the problem handler chain.
|
<T extends BeanDescription> |
introspect(JavaType type)
Method that will introspect full bean properties for the purpose
of building a bean deserializer
|
<T extends BeanDescription> |
introspectClassAnnotations(JavaType type)
Accessor for getting bean description that only contains class
annotations: useful if no getter/setter/creator information is needed.
|
<T extends 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> |
introspectForCreation(JavaType type)
Method that will introspect subset of bean properties needed to
construct bean instance.
|
boolean |
isAnnotationProcessingEnabled()
Method for determining whether annotation processing is enabled or not
(default settings are typically that it is enabled; must explicitly disable).
|
boolean |
isEnabled(DeserializationConfig.Feature f)
An overload for
MapperConfig.isEnabled(MapperConfig.ConfigFeature) ,
needed for backwards-compatibility. |
boolean |
isEnabled(MapperConfig.ConfigFeature f)
Method for checking whether given feature is enabled or not
|
KeyDeserializer |
keyDeserializerInstance(Annotated annotated,
Class<? extends KeyDeserializer> keyDeserClass) |
protected DeserializationConfig |
passSerializationFeatures(int serializationFeatureFlags)
Helper method to be called right after creating a non-shared
instance, needed to pass state of feature(s) shared with
SerializationConfig.
|
void |
set(DeserializationConfig.Feature f,
boolean state)
Deprecated.
Since 1.9, it is preferable to use
without(org.codehaus.jackson.map.DeserializationConfig.Feature...) and with(org.codehaus.jackson.map.DeserializationConfig.Feature...) instead;
this method is deprecated as it modifies current instance instead of
creating a new one (as the goal is to make this class immutable) |
boolean |
shouldSortPropertiesAlphabetically()
Accessor for checking whether default settings for property handling
indicate that properties should be alphabetically ordered or not.
|
ValueInstantiator |
valueInstantiatorInstance(Annotated annotated,
Class<? extends ValueInstantiator> instClass) |
DeserializationConfig |
with(DeserializationConfig.Feature... features)
Fluent factory method that will construct and return a new configuration
object instance with specified features enabled.
|
DeserializationConfig |
withAnnotationIntrospector(AnnotationIntrospector ai)
Method for constructing and returning a new instance with different
AnnotationIntrospector to use (replacing old one). |
DeserializationConfig |
withAppendedAnnotationIntrospector(AnnotationIntrospector ai)
Method for constructing and returning a new instance with additional
AnnotationIntrospector appended (as the lowest priority one) |
DeserializationConfig |
withClassIntrospector(ClassIntrospector<? extends BeanDescription> ci)
Method for constructing and returning a new instance with different
ClassIntrospector
to use. |
DeserializationConfig |
withDateFormat(DateFormat df)
Method for constructing and returning a new instance with different
DateFormat
to use. |
DeserializationConfig |
withHandlerInstantiator(HandlerInstantiator hi)
Method for constructing and returning a new instance with different
HandlerInstantiator
to use. |
DeserializationConfig |
withInsertedAnnotationIntrospector(AnnotationIntrospector ai)
Method for constructing and returning a new instance with additional
AnnotationIntrospector inserted (as the highest priority one) |
DeserializationConfig |
withNodeFactory(JsonNodeFactory f)
Fluent factory method that will construct a new instance with
specified
JsonNodeFactory |
DeserializationConfig |
without(DeserializationConfig.Feature... features)
Fluent factory method that will construct and return a new configuration
object instance with specified features disabled.
|
DeserializationConfig |
withPropertyNamingStrategy(PropertyNamingStrategy pns)
Method for constructing and returning a new instance with different
PropertyNamingStrategy
to use. |
DeserializationConfig |
withSubtypeResolver(SubtypeResolver str)
Method for constructing and returning a new instance with different
SubtypeResolver
to use. |
DeserializationConfig |
withTypeFactory(TypeFactory tf)
Method for constructing and returning a new instance with different
TypeFactory
to use. |
DeserializationConfig |
withTypeResolverBuilder(TypeResolverBuilder<?> trb)
Method for constructing and returning a new instance with different
TypeResolverBuilder
to use. |
DeserializationConfig |
withVisibility(JsonMethod forMethod,
JsonAutoDetect.Visibility visibility)
Method for constructing and returning a new instance with different
minimal visibility level for specified property type
|
DeserializationConfig |
withVisibilityChecker(VisibilityChecker<?> vc)
Method for constructing and returning a new instance with different
VisibilityChecker
to use. |
addMixInAnnotations, appendAnnotationIntrospector, constructSpecializedType, constructType, constructType, findMixInClassFor, getClassIntrospector, getDateFormat, getDefaultTyper, getHandlerInstantiator, getPropertyNamingStrategy, getSubtypeResolver, getTypeFactory, insertAnnotationIntrospector, introspectClassAnnotations, introspectDirectClassAnnotations, mixInCount, setAnnotationIntrospector, setDateFormat, setMixInAnnotations, typeIdResolverInstance, typeResolverBuilderInstance
protected LinkedNode<DeserializationProblemHandler> _problemHandlers
protected final JsonNodeFactory _nodeFactory
JsonNode
instances.protected boolean _sortPropertiesAlphabetically
SerializationConfig
which is needed to
know if serializer will by default sort properties in
alphabetic order.
Note that although this property is not marked as final,
it is handled like it was, except for the fact that it is
assigned with a call to passSerializationFeatures(int)
instead of constructor.
protected int _featureFlags
Note: moved to base class in 1.9; was stored by sub-class earlier
public DeserializationConfig(ClassIntrospector<? extends BeanDescription> intr, AnnotationIntrospector annIntr, VisibilityChecker<?> vc, SubtypeResolver subtypeResolver, PropertyNamingStrategy propertyNamingStrategy, TypeFactory typeFactory, HandlerInstantiator handlerInstantiator)
protected DeserializationConfig(DeserializationConfig src)
protected DeserializationConfig(DeserializationConfig src, MapperConfig.Base base)
protected DeserializationConfig(DeserializationConfig src, JsonNodeFactory f)
protected DeserializationConfig(DeserializationConfig src, int featureFlags)
protected DeserializationConfig passSerializationFeatures(int serializationFeatureFlags)
public DeserializationConfig withClassIntrospector(ClassIntrospector<? extends BeanDescription> ci)
MapperConfig
ClassIntrospector
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withClassIntrospector
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withAnnotationIntrospector(AnnotationIntrospector ai)
MapperConfig
AnnotationIntrospector
to use (replacing old one).
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withAnnotationIntrospector
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withVisibilityChecker(VisibilityChecker<?> vc)
MapperConfig
VisibilityChecker
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withVisibilityChecker
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withVisibility(JsonMethod forMethod, JsonAutoDetect.Visibility visibility)
MapperConfig
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withVisibility
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withTypeResolverBuilder(TypeResolverBuilder<?> trb)
MapperConfig
TypeResolverBuilder
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withTypeResolverBuilder
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withSubtypeResolver(SubtypeResolver str)
MapperConfig
SubtypeResolver
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withSubtypeResolver
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withPropertyNamingStrategy(PropertyNamingStrategy pns)
MapperConfig
PropertyNamingStrategy
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withPropertyNamingStrategy
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withTypeFactory(TypeFactory tf)
MapperConfig
TypeFactory
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withTypeFactory
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withDateFormat(DateFormat df)
MapperConfig
DateFormat
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withDateFormat
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withHandlerInstantiator(HandlerInstantiator hi)
MapperConfig
HandlerInstantiator
to use.
NOTE: make sure to register new instance with ObjectMapper
if directly calling this method.
withHandlerInstantiator
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withInsertedAnnotationIntrospector(AnnotationIntrospector ai)
MapperConfig
AnnotationIntrospector
inserted (as the highest priority one)withInsertedAnnotationIntrospector
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withAppendedAnnotationIntrospector(AnnotationIntrospector ai)
MapperConfig
AnnotationIntrospector
appended (as the lowest priority one)withAppendedAnnotationIntrospector
in class MapperConfig<DeserializationConfig>
public DeserializationConfig withNodeFactory(JsonNodeFactory f)
JsonNodeFactory
public DeserializationConfig with(DeserializationConfig.Feature... features)
public DeserializationConfig without(DeserializationConfig.Feature... features)
@Deprecated public void fromAnnotations(Class<?> cls)
Ones that are known to have effect are:
fromAnnotations
in class MapperConfig<DeserializationConfig>
cls
- Class of which class annotations to use
for changing configuration settingspublic DeserializationConfig createUnshared(SubtypeResolver subtypeResolver)
createUnshared
in class MapperConfig<DeserializationConfig>
public AnnotationIntrospector getAnnotationIntrospector()
AnnotationIntrospector
configured
to introspect annotation values used for configuration.getAnnotationIntrospector
in class MapperConfig<DeserializationConfig>
public <T extends BeanDescription> T introspectClassAnnotations(JavaType type)
Note: part of MapperConfig
since 1.7
introspectClassAnnotations
in class MapperConfig<DeserializationConfig>
public <T extends BeanDescription> T introspectDirectClassAnnotations(JavaType type)
Note: part of MapperConfig
since 1.7
introspectDirectClassAnnotations
in class MapperConfig<DeserializationConfig>
public boolean isAnnotationProcessingEnabled()
MapperConfig
isAnnotationProcessingEnabled
in class MapperConfig<DeserializationConfig>
public boolean canOverrideAccessModifiers()
MapperConfig
canOverrideAccessModifiers
in class MapperConfig<DeserializationConfig>
public boolean shouldSortPropertiesAlphabetically()
MapperConfig
shouldSortPropertiesAlphabetically
in class MapperConfig<DeserializationConfig>
public VisibilityChecker<?> getDefaultVisibilityChecker()
MapperConfig
JsonAutoDetect
annotation)getDefaultVisibilityChecker
in class MapperConfig<DeserializationConfig>
public boolean isEnabled(DeserializationConfig.Feature f)
MapperConfig.isEnabled(MapperConfig.ConfigFeature)
,
needed for backwards-compatibility.
NOTE: will remove either this variant, or base class one, in 2.0./
@Deprecated public void enable(DeserializationConfig.Feature f)
with(org.codehaus.jackson.map.DeserializationConfig.Feature...)
instead;
this method is deprecated as it modifies current instance instead of
creating a new one (as the goal is to make this class immutable)@Deprecated public void disable(DeserializationConfig.Feature f)
without(org.codehaus.jackson.map.DeserializationConfig.Feature...)
instead;
this method is deprecated as it modifies current instance instead of
creating a new one (as the goal is to make this class immutable)@Deprecated public void set(DeserializationConfig.Feature f, boolean state)
without(org.codehaus.jackson.map.DeserializationConfig.Feature...)
and with(org.codehaus.jackson.map.DeserializationConfig.Feature...)
instead;
this method is deprecated as it modifies current instance instead of
creating a new one (as the goal is to make this class immutable)public LinkedNode<DeserializationProblemHandler> getProblemHandlers()
public void addHandler(DeserializationProblemHandler h)
public void clearHandlers()
public Base64Variant getBase64Variant()
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 JsonDeserializer<Object> deserializerInstance(Annotated annotated, Class<? extends JsonDeserializer<?>> deserClass)
public KeyDeserializer keyDeserializerInstance(Annotated annotated, Class<? extends KeyDeserializer> keyDeserClass)
public ValueInstantiator valueInstantiatorInstance(Annotated annotated, Class<? extends ValueInstantiator> instClass)
public boolean isEnabled(MapperConfig.ConfigFeature f)
MapperConfig
isEnabled
in class MapperConfig<T extends org.codehaus.jackson.map.MapperConfig.Impl<CFG,T>>