|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.codehaus.jackson.map.DeserializationConfig
public class DeserializationConfig
Object that contains baseline configuration for deserialization
process. An instance is owned by 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.
| Nested Class Summary | |
|---|---|
static class |
DeserializationConfig.Feature
Enumeration that defines togglable features that guide the serialization feature. |
| Field Summary | |
|---|---|
protected AnnotationIntrospector |
_annotationIntrospector
Introspector used for accessing annotation value based configuration. |
protected ClassIntrospector<? extends BeanDescription> |
_classIntrospector
Introspector used to figure out Bean properties needed for bean serialization and deserialization. |
protected DateFormat |
_dateFormat
Custom date format to use for de-serialization. |
protected int |
_featureFlags
Bitset that contains all enabled features |
protected LinkedNode<DeserializationProblemHandler> |
_problemHandlers
Linked list that contains all registered problem handlers. |
protected static DateFormat |
DEFAULT_DATE_FORMAT
|
protected static int |
DEFAULT_FEATURE_FLAGS
Bitfield (set of flags) of all Features that are enabled by default. |
| Constructor Summary | |
|---|---|
|
DeserializationConfig(ClassIntrospector<? extends BeanDescription> intr,
AnnotationIntrospector annIntr)
|
protected |
DeserializationConfig(DeserializationConfig src)
|
| Method Summary | ||
|---|---|---|
void |
addHandler(DeserializationProblemHandler h)
Method that can be used to add a handler that can (try to) resolve non-fatal deserialization problems. |
|
void |
clearHandlers()
Method for removing all configuring problem handlers; usually done to replace existing handler(s) with different one(s) |
|
DeserializationConfig |
createUnshared()
Method that is called to create a non-shared copy of the configuration to be used for a deserialization operation. |
|
void |
disable(DeserializationConfig.Feature f)
Method for disabling specified feature. |
|
void |
enable(DeserializationConfig.Feature f)
Method for enabling specified feature. |
|
void |
fromAnnotations(Class<?> cls)
Method that checks class annotations that the argument Object has, and modifies settings of this configuration object accordingly, similar to how those annotations would affect actual value classes annotated with them, but with global scope. |
|
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. |
|
DateFormat |
getDateFormat()
|
|
LinkedNode<DeserializationProblemHandler> |
getProblemHandlers()
Method for getting head of the problem handler chain. |
|
|
introspect(JavaType type)
Method that will introspect full bean properties for the purpose of building a bean deserializer |
|
|
introspectClassAnnotations(Class<?> cls)
Accessor for getting bean description that only contains class annotations: useful if no getter/setter/creator information is needed. |
|
|
introspectForCreation(Class<?> cls)
Method that will introspect subset of bean properties needed to construct bean instance. |
|
boolean |
isEnabled(DeserializationConfig.Feature f)
Method for checking whether given feature is enabled or not |
|
void |
set(DeserializationConfig.Feature f,
boolean state)
Method for enabling or disabling specified feature. |
|
void |
setAnnotationIntrospector(AnnotationIntrospector introspector)
|
|
void |
setDateFormat(DateFormat df)
Method that will set the textual deserialization to use for deserializing Dates (and Calendars). |
|
void |
setIntrospector(ClassIntrospector<? extends BeanDescription> i)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int DEFAULT_FEATURE_FLAGS
protected static final DateFormat DEFAULT_DATE_FORMAT
protected ClassIntrospector<? extends BeanDescription> _classIntrospector
protected AnnotationIntrospector _annotationIntrospector
protected int _featureFlags
protected LinkedNode<DeserializationProblemHandler> _problemHandlers
protected DateFormat _dateFormat
StdDateFormat.
Note that the configured format object will be cloned once per deserialization process (first time it is needed)
| Constructor Detail |
|---|
public DeserializationConfig(ClassIntrospector<? extends BeanDescription> intr,
AnnotationIntrospector annIntr)
protected DeserializationConfig(DeserializationConfig src)
| Method Detail |
|---|
public DeserializationConfig createUnshared()
public void fromAnnotations(Class<?> cls)
Ones that are known to have effect are:
cls - Class of which class annotations to use
for changing configuration settingspublic void addHandler(DeserializationProblemHandler h)
public void clearHandlers()
public final boolean isEnabled(DeserializationConfig.Feature f)
public Base64Variant getBase64Variant()
public LinkedNode<DeserializationProblemHandler> getProblemHandlers()
public DateFormat getDateFormat()
public AnnotationIntrospector getAnnotationIntrospector()
AnnotationIntrospector configured
to introspect annotation values used for configuration.
public void setAnnotationIntrospector(AnnotationIntrospector introspector)
public <T extends BeanDescription> T introspect(JavaType type)
type - Type of class to be introspectedpublic <T extends BeanDescription> T introspectForCreation(Class<?> cls)
public <T extends BeanDescription> T introspectClassAnnotations(Class<?> cls)
public void enable(DeserializationConfig.Feature f)
public void disable(DeserializationConfig.Feature f)
public void set(DeserializationConfig.Feature f,
boolean state)
public void setDateFormat(DateFormat df)
StdDateFormat.
public void setIntrospector(ClassIntrospector<? extends BeanDescription> i)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||