|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<DeserializationConfig.Feature>
org.codehaus.jackson.map.DeserializationConfig.Feature
public static enum DeserializationConfig.Feature
Enumeration that defines togglable features that guide the serialization feature.
Enum Constant Summary | |
---|---|
ACCEPT_EMPTY_STRING_AS_NULL_OBJECT
Feature that can be enabled to allow JSON empty String value ("") to be bound to POJOs as null. |
|
ACCEPT_SINGLE_VALUE_AS_ARRAY
Feature that determines whether it is acceptable to coerce non-array (in JSON) values to work with Java collection (arrays, java.util.Collection) types. |
|
AUTO_DETECT_CREATORS
Feature that determines whether "creator" methods are automatically detected by consider public constructors, and static single argument methods with name "valueOf". |
|
AUTO_DETECT_FIELDS
Feature that determines whether non-static fields are recognized as properties. |
|
AUTO_DETECT_SETTERS
Feature that determines whether "setter" methods are automatically detected based on standard Bean naming convention or not. |
|
CAN_OVERRIDE_ACCESS_MODIFIERS
Feature that determines whether method and field access modifier settings can be overridden when accessing properties. |
|
FAIL_ON_NULL_FOR_PRIMITIVES
Feature that determines whether encountering of JSON null is an error when deserializing into Java primitive types (like 'int' or 'double'). |
|
FAIL_ON_NUMBERS_FOR_ENUMS
Feature that determines whether JSON integer numbers are valid values to be used for deserializing Java enum values. |
|
FAIL_ON_UNKNOWN_PROPERTIES
Feature that determines whether encountering of unknown properties (ones that do not map to a property, and there is no "any setter" or handler that can handle it) should result in a failure (by throwing a JsonMappingException ) or not. |
|
READ_ENUMS_USING_TO_STRING
Feature that determines standard deserialization mechanism used for Enum values: if enabled, Enums are assumed to have been serialized using return value of Enum.toString() ;
if disabled, return value of Enum.name() is assumed to have been used. |
|
USE_ANNOTATIONS
Feature that determines whether annotation introspection is used for configuration; if enabled, configured AnnotationIntrospector will be used: if disabled,
no annotations are considered. |
|
USE_BIG_DECIMAL_FOR_FLOATS
Feature that determines whether Json floating point numbers are to be deserialized into BigDecimal s
if only generic type description (either Object or
Number , or within untyped Map
or Collection context) is available. |
|
USE_BIG_INTEGER_FOR_INTS
Feature that determines whether Json integral (non-floating-point) numbers are to be deserialized into BigInteger s
if only generic type description (either Object or
Number , or within untyped Map
or Collection context) is available. |
|
USE_GETTERS_AS_SETTERS
Feature that determines whether otherwise regular "getter" methods (but only ones that handle Collections and Maps, not getters of other type) can be used for purpose of getting a reference to a Collection and Map to modify the property, without requiring a setter method. |
|
WRAP_EXCEPTIONS
Feature that determines whether Jackson code should catch and wrap Exception s (but never Error s!)
to add additional information about
location (within input) of problem or not. |
|
WRAP_ROOT_VALUE
Deprecated. Never implemented; plus, incorrectly named: should be "UNWRAP_ROOT_VALUE" to be of use. Feature such named may be added in future. |
Method Summary | |
---|---|
static int |
collectDefaults()
Method that calculates bit set (flags) of all features that are enabled by default. |
boolean |
enabledByDefault()
|
int |
getMask()
|
static DeserializationConfig.Feature |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static DeserializationConfig.Feature[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final DeserializationConfig.Feature USE_ANNOTATIONS
AnnotationIntrospector
will be used: if disabled,
no annotations are considered.
Feature is enabled by default.
public static final DeserializationConfig.Feature AUTO_DETECT_SETTERS
Note that this feature has lower precedence than per-class annotations, and is only used if there isn't more granular configuration available.
Feature is enabled by default.
public static final DeserializationConfig.Feature AUTO_DETECT_CREATORS
Note that this feature has lower precedence than per-class annotations, and is only used if there isn't more granular configuration available.
Feature is enabled by default.
public static final DeserializationConfig.Feature AUTO_DETECT_FIELDS
Note that this feature has lower precedence than per-class annotations, and is only used if there isn't more granular configuration available.
Feature is enabled by default.
public static final DeserializationConfig.Feature USE_GETTERS_AS_SETTERS
Note that such getters-as-setters methods have lower precedence than setters, so they are only used if no setter is found for the Map/Collection property.
Feature is enabled by default.
public static final DeserializationConfig.Feature CAN_OVERRIDE_ACCESS_MODIFIERS
AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)
may be called to enable access to otherwise unaccessible
objects.
public static final DeserializationConfig.Feature USE_BIG_DECIMAL_FOR_FLOATS
BigDecimal
s
if only generic type description (either Object
or
Number
, or within untyped Map
or Collection
context) is available.
If enabled such values will be deserialized as BigDecimal
s;
if disabled, will be deserialized as Double
s.
Feature is disabled by default, meaning that "untyped" floating
point numbers will by default be deserialized as Double
s
(choice is for performance reason -- BigDecimals are slower than
Doubles)
public static final DeserializationConfig.Feature USE_BIG_INTEGER_FOR_INTS
BigInteger
s
if only generic type description (either Object
or
Number
, or within untyped Map
or Collection
context) is available.
If enabled such values will be deserialized as
BigInteger
s;
if disabled, will be deserialized as "smallest" available type,
which is either Integer
, Long
or
BigInteger
, depending on number of digits.
Feature is disabled by default, meaning that "untyped" floating point numbers will by default be deserialized using whatever is the most compact integral type, to optimize efficiency.
public static final DeserializationConfig.Feature READ_ENUMS_USING_TO_STRING
Enum.toString()
;
if disabled, return value of Enum.name()
is assumed to have been used.
Since pre-1.6 method was to use Enum name, this is the default.
Note: this feature should usually have same value
as SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING
.
For further details, check out [JACKSON-212]
public static final DeserializationConfig.Feature FAIL_ON_UNKNOWN_PROPERTIES
JsonMappingException
) or not.
This setting only takes effect after all other handling
methods for unknown properties have been tried, and
property remains unhandled.
Feature is enabled by default, meaning that
JsonMappingException
is thrown if an unknown property
is encountered. This is the implicit default prior to
introduction of the feature.
public static final DeserializationConfig.Feature FAIL_ON_NULL_FOR_PRIMITIVES
Feature is disabled by default (to be consistent with behavior of Jackson 1.6), i.e. to allow use of nulls for primitive properties.
public static final DeserializationConfig.Feature FAIL_ON_NUMBERS_FOR_ENUMS
JsonMappingException
will be thrown.
Latter behavior makes sense if there is concern that accidental
mapping from integer values to enums might happen (and when enums
are always serialized as JSON Strings)
Feature is disabled by default (to be consistent with behavior of Jackson 1.6), i.e. to allow use of JSON integers for Java enums.
public static final DeserializationConfig.Feature WRAP_EXCEPTIONS
Exception
s (but never Error
s!)
to add additional information about
location (within input) of problem or not. If enabled,
most exceptions will be caught and re-thrown (exception
specifically being that IOException
s may be passed
as is, since they are declared as throwable); this can be
convenient both in that all exceptions will be checked and
declared, and so there is more contextual information.
However, sometimes calling application may just want "raw"
unchecked exceptions passed as is.
Feature is enabled by default, and is similar in behavior to default prior to 1.7.
@Deprecated public static final DeserializationConfig.Feature WRAP_ROOT_VALUE
SerializationConfig.Feature.WRAP_ROOT_VALUE
for details).
NOTE: Not implemented (unlike its counterpart for serialization
which was implemented in 1.7)
public static final DeserializationConfig.Feature ACCEPT_EMPTY_STRING_AS_NULL_OBJECT
public static final DeserializationConfig.Feature ACCEPT_SINGLE_VALUE_AS_ARRAY
Method Detail |
---|
public static DeserializationConfig.Feature[] values()
for (DeserializationConfig.Feature c : DeserializationConfig.Feature.values()) System.out.println(c);
public static DeserializationConfig.Feature valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic static int collectDefaults()
public boolean enabledByDefault()
public int getMask()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |