com.fasterxml.jackson.databind
Class DeserializationConfig

java.lang.Object
  extended by com.fasterxml.jackson.databind.cfg.MapperConfig<T>
      extended by com.fasterxml.jackson.databind.cfg.MapperConfigBase<DeserializationFeature,DeserializationConfig>
          extended by 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. Note also that unlike with Jackson 1, these instances can not be assigned to ObjectMapper; in fact, application code should rarely interact directly with these instance (unlike core Jackson code)

See Also:
Serialized Form

Field Summary
protected  int _deserFeatures
          Set of features enabled; actual type (kind of features) depends on sub-classes.
protected  JsonNodeFactory _nodeFactory
          Factory used for constructing JsonNode instances.
protected  LinkedNode<DeserializationProblemHandler> _problemHandlers
          Linked list that contains all registered problem handlers.
 
Fields inherited from class com.fasterxml.jackson.databind.cfg.MapperConfigBase
_mixInAnnotations, _rootName, _subtypeResolver, _view
 
Fields inherited from class com.fasterxml.jackson.databind.cfg.MapperConfig
_base, _mapperFeatures
 
Constructor Summary
  DeserializationConfig(BaseSettings base, SubtypeResolver str, Map<ClassKey,Class<?>> mixins)
          Constructor used by ObjectMapper to create default configuration object instance.
protected DeserializationConfig(DeserializationConfig src, Map<ClassKey,Class<?>> mixins)
           
 
Method Summary
 AnnotationIntrospector getAnnotationIntrospector()
          Method for getting AnnotationIntrospector configured to introspect annotation values used for configuration.
protected  BaseSettings getBaseSettings()
           
 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).
 int getDeserializationFeatures()
           
 JsonNodeFactory getNodeFactory()
           
 LinkedNode<DeserializationProblemHandler> getProblemHandlers()
          Method for getting head of the problem handler chain.
<T extends BeanDescription>
T
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>
T
introspectForBuilder(JavaType type)
           
<T extends BeanDescription>
T
introspectForCreation(JavaType type)
          Method that will introspect subset of bean properties needed to construct bean instance.
 boolean isEnabled(DeserializationFeature f)
           
 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(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(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(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(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 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(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 withRootName(String 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
 
Methods inherited from class com.fasterxml.jackson.databind.cfg.MapperConfigBase
findMixInClassFor, getActiveView, getRootName, getSubtypeResolver, mixInCount
 
Methods inherited from class com.fasterxml.jackson.databind.cfg.MapperConfig
canOverrideAccessModifiers, collectFeatureDefaults, constructSpecializedType, constructType, constructType, getBase64Variant, getClassIntrospector, getDateFormat, getDefaultTyper, getHandlerInstantiator, getLocale, getPropertyNamingStrategy, getTimeZone, getTypeFactory, introspectClassAnnotations, 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

_deserFeatures

protected final int _deserFeatures
Set of features enabled; actual type (kind of features) depends on sub-classes.


_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.

Constructor Detail

DeserializationConfig

public DeserializationConfig(BaseSettings base,
                             SubtypeResolver str,
                             Map<ClassKey,Class<?>> mixins)
Constructor used by ObjectMapper to create default configuration object instance.


DeserializationConfig

protected DeserializationConfig(DeserializationConfig src,
                                Map<ClassKey,Class<?>> mixins)
Since:
2.1
Method Detail

getBaseSettings

protected BaseSettings getBaseSettings()

with

public DeserializationConfig with(MapperFeature... features)
Description copied from class: MapperConfig
Method for constructing and returning a new instance with specified mapper features enabled.

Specified by:
with in class MapperConfig<DeserializationConfig>

without

public DeserializationConfig without(MapperFeature... features)
Description copied from class: MapperConfig
Method for constructing and returning a new instance with specified mapper features disabled.

Specified by:
without in class MapperConfig<DeserializationConfig>

with

public DeserializationConfig with(ClassIntrospector ci)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different ClassIntrospector to use.

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

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

with

public DeserializationConfig with(AnnotationIntrospector ai)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different AnnotationIntrospector to use (replacing old one).

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

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

with

public DeserializationConfig with(VisibilityChecker<?> vc)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different VisibilityChecker to use.

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

withVisibility

public DeserializationConfig withVisibility(PropertyAccessor forMethod,
                                            JsonAutoDetect.Visibility visibility)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different minimal visibility level for specified property type

Specified by:
withVisibility in class MapperConfigBase<DeserializationFeature,DeserializationConfig>

with

public DeserializationConfig with(TypeResolverBuilder<?> trb)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different TypeResolverBuilder to use.

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>

with

public DeserializationConfig with(PropertyNamingStrategy pns)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different PropertyNamingStrategy 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(String 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.

with

public DeserializationConfig with(TypeFactory tf)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different TypeFactory to use.

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

with

public DeserializationConfig with(DateFormat df)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different DateFormat to use.

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

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

with

public DeserializationConfig with(HandlerInstantiator hi)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different HandlerInstantiator to use.

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

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

withInsertedAnnotationIntrospector

public DeserializationConfig withInsertedAnnotationIntrospector(AnnotationIntrospector ai)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with additional AnnotationIntrospector inserted (as the highest priority one)

Specified by:
withInsertedAnnotationIntrospector in class MapperConfigBase<DeserializationFeature,DeserializationConfig>

withAppendedAnnotationIntrospector

public DeserializationConfig withAppendedAnnotationIntrospector(AnnotationIntrospector ai)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with additional AnnotationIntrospector appended (as the lowest priority one)

Specified by:
withAppendedAnnotationIntrospector in class MapperConfigBase<DeserializationFeature,DeserializationConfig>

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(Locale l)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different default Locale to use for formatting.

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

with

public DeserializationConfig with(TimeZone tz)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different default TimeZone to use for formatting of date values.

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

with

public DeserializationConfig with(Base64Variant base64)
Description copied from class: MapperConfigBase
Method for constructing and returning a new instance with different default Base64Variant to use with base64-encoded binary values.

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

with

public DeserializationConfig with(JsonNodeFactory f)
Fluent factory method that will construct a new instance with specified JsonNodeFactory


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)


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.


getAnnotationIntrospector

public AnnotationIntrospector getAnnotationIntrospector()
Method for getting AnnotationIntrospector configured to introspect annotation values used for configuration.

Overrides:
getAnnotationIntrospector in class MapperConfig<DeserializationConfig>

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>

introspectClassAnnotations

public BeanDescription introspectClassAnnotations(JavaType type)
Accessor for getting bean description that only contains class annotations: useful if no getter/setter/creator information is needed.

Specified by:
introspectClassAnnotations in class MapperConfig<DeserializationConfig>

introspectDirectClassAnnotations

public 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.

Specified by:
introspectDirectClassAnnotations in class MapperConfig<DeserializationConfig>

getDefaultVisibilityChecker

public VisibilityChecker<?> getDefaultVisibilityChecker()
Description copied from class: MapperConfig
Accessor for object used for determining whether specific property elements (method, constructors, fields) can be auto-detected based on their visibility (access modifiers). Can be changed to allow different minimum visibility levels for auto-detection. Note that this is the global handler; individual types (classes) can further override active checker used (using JsonAutoDetect annotation)

Overrides:
getDefaultVisibilityChecker in class MapperConfig<DeserializationConfig>

isEnabled

public final boolean isEnabled(DeserializationFeature f)

getDeserializationFeatures

public final int getDeserializationFeatures()

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()

introspect

public <T extends BeanDescription> T 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 <T extends BeanDescription> T introspectForCreation(JavaType type)
Method that will introspect subset of bean properties needed to construct bean instance.


introspectForBuilder

public <T extends BeanDescription> T introspectForBuilder(JavaType type)
Since:
2.0


Copyright © 2012 FasterXML. All Rights Reserved.