Top Description Fields Constructors Methods
com.fasterxml.jackson.databind

public final Enum DeserializationFeature

extends Enum<DeserializationFeature>
implements ConfigFeature
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.cfg.ConfigFeature
Imports
com.fasterxml.jackson.databind.cfg.ConfigFeature, com.fasterxml.jackson.databind.exc.InvalidNullException

Enumeration that defines simple on/off features that affect the way Java objects are deserialized from JSON

Note that features can be set both through ObjectMapper (as sort of defaults) and through ObjectReader. In first case these defaults must follow "config-then-use" patterns (i.e. defined once, not changed afterwards); all per-call changes must be done using ObjectReader.

Note that features that do not indicate version of inclusion were available in Jackson 2.0 (or earlier); only later additions indicate version of inclusion.

Field Summary

Modifier and TypeField and Description
private final boolean
private final int
public static final DeserializationFeature
ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT

Feature that can be enabled to allow empty JSON Array value (that is, [ ]) to be bound to POJOs (and with 2.9, other values too) as `null`.

public static final DeserializationFeature
ACCEPT_EMPTY_STRING_AS_NULL_OBJECT

Feature that can be enabled to allow JSON empty String value ("") to be bound as `null` for POJOs and other structured values (java.util.Maps, java.util.Collections).

public static final DeserializationFeature
ACCEPT_FLOAT_AS_INT

Feature that determines whether coercion from JSON floating point number (anything with command (`.`) or exponent portion (`e` / `E')) to an expected integral number (`int`, `long`, `java.lang.Integer`, `java.lang.Long`, `java.math.BigDecimal`) is allowed or not.

public static final DeserializationFeature
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.

public static final DeserializationFeature
ADJUST_DATES_TO_CONTEXT_TIME_ZONE

Feature that specifies whether context provided java.util.TimeZone (DeserializationContext#getTimeZone() should be used to adjust Date/Time values on deserialization, even if value itself contains timezone information.

public static final DeserializationFeature
EAGER_DESERIALIZER_FETCH

Feature that determines whether ObjectReader should try to eagerly fetch necessary JsonDeserializer when possible.

public static final DeserializationFeature
FAIL_ON_IGNORED_PROPERTIES

Feature that determines what happens when a property that has been explicitly marked as ignorable is encountered in input: if feature is enabled, JsonMappingException is thrown; if false, property is quietly skipped.

public static final DeserializationFeature
FAIL_ON_INVALID_SUBTYPE

Feature that determines what happens when type of a polymorphic value (indicated for example by com.fasterxml.jackson.annotation.JsonTypeInfo) cannot be found (missing) or resolved (invalid class name, non-mappable id); if enabled, an exception is thrown; if false, null value is used instead.

public static final DeserializationFeature
FAIL_ON_MISSING_CREATOR_PROPERTIES

Feature that determines what happens if one or more Creator properties (properties bound to parameters of Creator method (constructor or static factory method)) are missing value to bind to from content.

public static final DeserializationFeature
FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY

Feature that determines what happens when a property annotated with com.fasterxml.jackson.annotation.JsonTypeInfo.As#EXTERNAL_PROPERTY is missing, but associated type id is available.

public static final DeserializationFeature
FAIL_ON_NULL_CREATOR_PROPERTIES

Feature that determines what happens if one or more Creator properties (properties bound to parameters of Creator method (constructor or static factory method)) are bound to null values - either from the JSON or as a default value.

public static final DeserializationFeature
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').

public static final DeserializationFeature
FAIL_ON_NUMBERS_FOR_ENUMS

Feature that determines whether JSON integer numbers are valid values to be used for deserializing Java enum values.

public static final DeserializationFeature
FAIL_ON_READING_DUP_TREE_KEY

Feature that determines what happens when reading JSON content into tree (com.fasterxml.jackson.core.TreeNode) and a duplicate key is encountered (property name that was already seen for the JSON Object).

public static final DeserializationFeature
FAIL_ON_TRAILING_TOKENS

Feature that determines behaviour for data-binding after binding the root value.

public static final DeserializationFeature
FAIL_ON_UNEXPECTED_VIEW_PROPERTIES

Feature that determines the handling of properties not included in the active JSON view during deserialization.

public static final DeserializationFeature
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.

public static final DeserializationFeature
FAIL_ON_UNRESOLVED_OBJECT_IDS

Feature that determines what happens if an Object Id reference is encountered that does not refer to an actual Object with that id ("unresolved Object Id"): either an exception com.fasterxml.jackson.databind.deser.UnresolvedForwardReference containing information about com.fasterxml.jackson.databind.deser.UnresolvedId is thrown (true), or a null object is used instead (false).

public static final DeserializationFeature
READ_DATE_TIMESTAMPS_AS_NANOSECONDS

Feature that controls whether numeric timestamp values are expected to be written using nanosecond timestamps (enabled) or not (disabled), if and only if datatype supports such resolution.

public static final DeserializationFeature
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.

public static final DeserializationFeature
READ_UNKNOWN_ENUM_VALUES_AS_NULL

Feature that allows unknown Enum values to be parsed as null values.

public static final DeserializationFeature
READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE

Feature that allows unknown Enum values to be ignored and replaced by a predefined value specified through @JsonEnumDefaultValue annotation.

public static final DeserializationFeature
UNWRAP_ROOT_VALUE

Feature to allow "unwrapping" root-level JSON value, to match setting of SerializationFeature#WRAP_ROOT_VALUE used for serialization.

public static final DeserializationFeature
UNWRAP_SINGLE_VALUE_ARRAYS

Feature that determines whether it is acceptable to coerce single value array (in JSON) values to the corresponding value type.

public static final DeserializationFeature
USE_BIG_DECIMAL_FOR_FLOATS

Feature that determines whether JSON floating point numbers are to be deserialized into java.math.BigDecimals if only generic type description (either Object or Number, or within untyped java.util.Map or java.util.Collection context) is available.

public static final DeserializationFeature
USE_BIG_INTEGER_FOR_INTS

Feature that determines whether JSON integral (non-floating-point) numbers are to be deserialized into java.math.BigIntegers if only generic type description (either Object or Number, or within untyped java.util.Map or java.util.Collection context) is available.

public static final DeserializationFeature
USE_JAVA_ARRAY_FOR_JSON_ARRAY

Feature that determines whether JSON Array is mapped to Object[] or List<Object> when binding "untyped" objects (ones with nominal type of java.lang.Object).

public static final DeserializationFeature
USE_LONG_FOR_INTS

Feature that determines how "small" JSON integral (non-floating-point) numbers -- ones that fit in 32-bit signed integer (`int`) -- are bound when target type is loosely typed as Object or Number (or within untyped java.util.Map or java.util.Collection context).

public static final DeserializationFeature
WRAP_EXCEPTIONS

Feature that determines whether Jackson code should catch and wrap Exceptions (but never Errors!) to add additional information about location (within input) of problem or not.

Constructor Summary

AccessConstructor and Description
private
DeserializationFeature(boolean defaultState)

Method Summary

Modifier and TypeMethod and Description
public boolean
enabledByDefault()

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

public boolean
enabledIn(int flags)

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask

public int
getMask()

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.getMask.

Returns bit mask for this feature instance

public static DeserializationFeature
public static DeserializationFeature[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

_defaultStateback to summary
private final boolean _defaultState
_maskback to summary
private final int _mask
ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECTback to summary
public static final DeserializationFeature ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT

Feature that can be enabled to allow empty JSON Array value (that is, [ ]) to be bound to POJOs (and with 2.9, other values too) as `null`. If disabled, standard POJOs can only be bound from JSON `null` or JSON Object (standard meaning that no custom deserializers or constructors are defined; both of which can add support for other kinds of JSON values); if enabled, empty JSON Array will be taken to be equivalent of JSON null.

Feature is disabled by default.

Since
2.5
ACCEPT_EMPTY_STRING_AS_NULL_OBJECTback to summary
public static final DeserializationFeature ACCEPT_EMPTY_STRING_AS_NULL_OBJECT

Feature that can be enabled to allow JSON empty String value ("") to be bound as `null` for POJOs and other structured values (java.util.Maps, java.util.Collections). If disabled, standard POJOs can only be bound from JSON `null` or JSON Object (standard meaning that no custom deserializers or constructors are defined; both of which can add support for other kinds of JSON values); if enabled, empty JSON String can be taken to be equivalent of JSON null.

Note

this does NOT apply to scalar values such as booleans, numbers and date/time types; whether these can be coerced depends on MapperFeature#ALLOW_COERCION_OF_SCALARS.

Feature is disabled by default.

ACCEPT_FLOAT_AS_INTback to summary
public static final DeserializationFeature ACCEPT_FLOAT_AS_INT

Feature that determines whether coercion from JSON floating point number (anything with command (`.`) or exponent portion (`e` / `E')) to an expected integral number (`int`, `long`, `java.lang.Integer`, `java.lang.Long`, `java.math.BigDecimal`) is allowed or not. If enabled, coercion truncates value; if disabled, a JsonMappingException will be thrown.

Feature is enabled by default.

Since
2.6
ACCEPT_SINGLE_VALUE_AS_ARRAYback to summary
public static final DeserializationFeature 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. If enabled, collection deserializers will try to handle non-array values as if they had "implicit" surrounding JSON array. This feature is meant to be used for compatibility/interoperability reasons, to work with packages (such as XML-to-JSON converters) that leave out JSON array in cases where there is just a single element in array.

Feature is disabled by default.

ADJUST_DATES_TO_CONTEXT_TIME_ZONEback to summary
public static final DeserializationFeature ADJUST_DATES_TO_CONTEXT_TIME_ZONE

Feature that specifies whether context provided java.util.TimeZone (DeserializationContext#getTimeZone() should be used to adjust Date/Time values on deserialization, even if value itself contains timezone information. If enabled, contextual TimeZone will essentially override any other TimeZone information; if disabled, it will only be used if value itself does not contain any TimeZone information.

Note that exact behavior depends on date/time types in question; and specifically JDK type of java.util.Date does NOT have in-built timezone information so this setting has no effect. Further, while java.util.Calendar does have this information basic JDK java.text.SimpleDateFormat is unable to retain parsed zone information, and as a result, java.util.Calendar will always get context timezone adjustment regardless of this setting.

Taking above into account, this feature is supported only by extension modules for Joda and Java 8 date/time datatypes.

Since
2.2
EAGER_DESERIALIZER_FETCHback to summary
public static final DeserializationFeature EAGER_DESERIALIZER_FETCH

Feature that determines whether ObjectReader should try to eagerly fetch necessary JsonDeserializer when possible. This improves performance in cases where similarly configured ObjectReader instance is used multiple times; and should not significantly affect single-use cases.

Note that there should not be any need to normally disable this feature: only consider that if there are actual perceived problems.

Feature is enabled by default.

Since
2.1
FAIL_ON_IGNORED_PROPERTIESback to summary
public static final DeserializationFeature FAIL_ON_IGNORED_PROPERTIES

Feature that determines what happens when a property that has been explicitly marked as ignorable is encountered in input: if feature is enabled, JsonMappingException is thrown; if false, property is quietly skipped.

Feature is disabled by default so that no exception is thrown.

Since
2.3
FAIL_ON_INVALID_SUBTYPEback to summary
public static final DeserializationFeature FAIL_ON_INVALID_SUBTYPE

Feature that determines what happens when type of a polymorphic value (indicated for example by com.fasterxml.jackson.annotation.JsonTypeInfo) cannot be found (missing) or resolved (invalid class name, non-mappable id); if enabled, an exception is thrown; if false, null value is used instead.

Feature is enabled by default so that exception is thrown for missing or invalid type information.

Since
2.2
FAIL_ON_MISSING_CREATOR_PROPERTIESback to summary
public static final DeserializationFeature FAIL_ON_MISSING_CREATOR_PROPERTIES

Feature that determines what happens if one or more Creator properties (properties bound to parameters of Creator method (constructor or static factory method)) are missing value to bind to from content. If enabled, such missing values result in a JsonMappingException being thrown with information on the first one (by index) of missing properties. If disabled, and if property is NOT marked as required, missing Creator properties are filled with null values provided by deserializer for the type of parameter (usually null for Object types, and default value for primitives; but redefinable via custom deserializers).

Note that having an injectable value counts as "not missing".

Feature is disabled by default, so that no exception is thrown for missing creator property values, unless they are explicitly marked as `required`.

Since
2.6
FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTYback to summary
public static final DeserializationFeature FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY

Feature that determines what happens when a property annotated with com.fasterxml.jackson.annotation.JsonTypeInfo.As#EXTERNAL_PROPERTY is missing, but associated type id is available. If enabled, JsonMappingException is always thrown when property value is missing (if type id does exist); if disabled, exception is only thrown if property is marked as `required`.

Feature is enabled by default, so that exception is thrown when a subtype property is missing.

Since
2.9
FAIL_ON_NULL_CREATOR_PROPERTIESback to summary
public static final DeserializationFeature FAIL_ON_NULL_CREATOR_PROPERTIES

Feature that determines what happens if one or more Creator properties (properties bound to parameters of Creator method (constructor or static factory method)) are bound to null values - either from the JSON or as a default value. This is useful if you want to avoid nulls in your codebase, and particularly useful if you are using Java or Scala optionals for non-mandatory fields. Feature is disabled by default, so that no exception is thrown for missing creator property values, unless they are explicitly marked as `required`.

Since
2.8
FAIL_ON_NULL_FOR_PRIMITIVESback to summary
public static final DeserializationFeature 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'). If it is, a InvalidNullException is thrown to indicate this; if not, default value is used (0 for 'int', 0.0 for double, same defaulting as what JVM uses).

Feature is disabled by default.

FAIL_ON_NUMBERS_FOR_ENUMSback to summary
public static final DeserializationFeature FAIL_ON_NUMBERS_FOR_ENUMS

Feature that determines whether JSON integer numbers are valid values to be used for deserializing Java enum values. If set to 'false' numbers are acceptable and are used to map to ordinal() of matching enumeration value; if 'true', numbers are not allowed and a 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.

FAIL_ON_READING_DUP_TREE_KEYback to summary
public static final DeserializationFeature FAIL_ON_READING_DUP_TREE_KEY

Feature that determines what happens when reading JSON content into tree (com.fasterxml.jackson.core.TreeNode) and a duplicate key is encountered (property name that was already seen for the JSON Object). If enabled, JsonMappingException will be thrown; if disabled, no exception is thrown and the new (later) value overwrites the earlier value.

Note that this property does NOT affect other aspects of data-binding; that is, no detection is done with respect to POJO properties or java.util.Map keys. New features may be added to control additional cases.

Feature is disabled by default so that no exception is thrown.

Since
2.3
FAIL_ON_TRAILING_TOKENSback to summary
public static final DeserializationFeature FAIL_ON_TRAILING_TOKENS

Feature that determines behaviour for data-binding after binding the root value. If feature is enabled, one more call to com.fasterxml.jackson.core.JsonParser#nextToken is made to ensure that no more tokens are found (and if any is found, com.fasterxml.jackson.databind.exc.MismatchedInputException is thrown); if disabled, no further checks are made.

Feature could alternatively be called READ_FULL_STREAM, since it effectively verifies that input stream contains only as much data as is needed for binding the full value, and nothing more (except for possible ignorable white space or comments, if supported by data format).

Feature is disabled by default (so that no check is made for possible trailing token(s)) for backwards compatibility reasons.

Since
2.9
FAIL_ON_UNEXPECTED_VIEW_PROPERTIESback to summary
public static final DeserializationFeature FAIL_ON_UNEXPECTED_VIEW_PROPERTIES

Feature that determines the handling of properties not included in the active JSON view during deserialization.

When enabled, if a property is encountered during deserialization that is not part of the active view (as defined by com.fasterxml.jackson.annotation.JsonView).

This feature is particularly useful in scenarios where strict adherence to the specified view is required and any deviation, such as the presence of properties not belonging to the view, should be reported as an error. It enhances the robustness of data binding by ensuring that only the properties relevant to the active view are considered during deserialization, thereby preventing unintended data from being processed.

In Jackson 2.x, this feature is disabled by default to maintain backward compatibility. In Jackson 3.x, this feature may be enabled by default.

Since
2.17
FAIL_ON_UNKNOWN_PROPERTIESback to summary
public static final DeserializationFeature 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. 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 a JsonMappingException will be thrown if an unknown property is encountered).

FAIL_ON_UNRESOLVED_OBJECT_IDSback to summary
public static final DeserializationFeature FAIL_ON_UNRESOLVED_OBJECT_IDS

Feature that determines what happens if an Object Id reference is encountered that does not refer to an actual Object with that id ("unresolved Object Id"): either an exception com.fasterxml.jackson.databind.deser.UnresolvedForwardReference containing information about com.fasterxml.jackson.databind.deser.UnresolvedId is thrown (true), or a null object is used instead (false). Note that if this is set to false, no further processing is done; specifically, if reference is defined via setter method, that method will NOT be called.

Feature is enabled by default, so that unknown Object Ids will result in an exception being thrown, at the end of deserialization.

Since
2.5
READ_DATE_TIMESTAMPS_AS_NANOSECONDSback to summary
public static final DeserializationFeature READ_DATE_TIMESTAMPS_AS_NANOSECONDS

Feature that controls whether numeric timestamp values are expected to be written using nanosecond timestamps (enabled) or not (disabled), if and only if datatype supports such resolution. Only newer datatypes (such as Java8 Date/Time) support such resolution -- older types (pre-Java8 java.util.Date etc) and Joda do not -- and this setting has no effect on such types.

If disabled, standard millisecond timestamps are assumed. This is the counterpart to SerializationFeature#WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS.

Feature is enabled by default, to support most accurate time values possible.

Since
2.2
READ_ENUMS_USING_TO_STRINGback to summary
public static final DeserializationFeature 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.

Note

this feature should usually have same value as SerializationFeature#WRITE_ENUMS_USING_TO_STRING.

Feature is disabled by default.

READ_UNKNOWN_ENUM_VALUES_AS_NULLback to summary
public static final DeserializationFeature READ_UNKNOWN_ENUM_VALUES_AS_NULL

Feature that allows unknown Enum values to be parsed as null values. If disabled, unknown Enum values will throw exceptions.

Note that in some cases this will effectively ignore unknown Enum values, e.g. when the unknown values are used as keys of java.util.EnumMap or values of java.util.EnumSet: this is because these data structures cannot store null values.

Also note that this feature has lower precedence than DeserializationFeature#READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE, meaning this feature will work only if latter feature is disabled.

Feature is disabled by default.

Since
2.0
READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUEback to summary
public static final DeserializationFeature READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE

Feature that allows unknown Enum values to be ignored and replaced by a predefined value specified through @JsonEnumDefaultValue annotation. If disabled, unknown Enum values will throw exceptions. If enabled, but no predefined default Enum value is specified, an exception will be thrown as well.

Note that this feature has higher precedence than DeserializationFeature#READ_UNKNOWN_ENUM_VALUES_AS_NULL.

Feature is disabled by default.

Since
2.8
UNWRAP_ROOT_VALUEback to summary
public static final DeserializationFeature UNWRAP_ROOT_VALUE

Feature to allow "unwrapping" root-level JSON value, to match setting of SerializationFeature#WRAP_ROOT_VALUE used for serialization. Will verify that the root JSON value is a JSON Object, and that it has a single property with expected root name. If not, a JsonMappingException is thrown; otherwise value of the wrapped property will be deserialized as if it was the root value.

Feature is disabled by default.

UNWRAP_SINGLE_VALUE_ARRAYSback to summary
public static final DeserializationFeature UNWRAP_SINGLE_VALUE_ARRAYS

Feature that determines whether it is acceptable to coerce single value array (in JSON) values to the corresponding value type. This is basically the opposite of the ACCEPT_SINGLE_VALUE_AS_ARRAY feature. If more than one value is found in the array, a JsonMappingException is thrown.

Note

only single wrapper Array is allowed: if multiple attempted, exception will be thrown. Feature is disabled by default.

Since
2.4
USE_BIG_DECIMAL_FOR_FLOATSback to summary
public static final DeserializationFeature USE_BIG_DECIMAL_FOR_FLOATS

Feature that determines whether JSON floating point numbers are to be deserialized into java.math.BigDecimals if only generic type description (either Object or Number, or within untyped java.util.Map or java.util.Collection context) is available. If enabled such values will be deserialized as java.math.BigDecimals; if disabled, will be deserialized as Doubles.

Note

one aspect of java.math.BigDecimal handling that may need configuring is whether trailing zeroes are trimmed: com.fasterxml.jackson.databind.node.JsonNodeFactory has com.fasterxml.jackson.databind.node.JsonNodeFactory#withExactBigDecimals for changing default behavior (default is for trailing zeroes to be trimmed).

Feature is disabled by default, meaning that "untyped" floating point numbers will by default be deserialized as Doubles (choice is for performance reason -- BigDecimals are slower than Doubles).

USE_BIG_INTEGER_FOR_INTSback to summary
public static final DeserializationFeature USE_BIG_INTEGER_FOR_INTS

Feature that determines whether JSON integral (non-floating-point) numbers are to be deserialized into java.math.BigIntegers if only generic type description (either Object or Number, or within untyped java.util.Map or java.util.Collection context) is available. If enabled such values will be deserialized as java.math.BigIntegers; if disabled, will be deserialized as "smallest" available type, which is either Integer, Long or java.math.BigInteger, depending on number of digits.

Feature is disabled by default, meaning that "untyped" integral numbers will by default be deserialized using whatever is the most compact integral type, to optimize efficiency.

USE_JAVA_ARRAY_FOR_JSON_ARRAYback to summary
public static final DeserializationFeature USE_JAVA_ARRAY_FOR_JSON_ARRAY

Feature that determines whether JSON Array is mapped to Object[] or List<Object> when binding "untyped" objects (ones with nominal type of java.lang.Object). If true, binds as Object[]; if false, as List<Object>.

Feature is disabled by default, meaning that JSON arrays are bound as java.util.Lists.

USE_LONG_FOR_INTSback to summary
public static final DeserializationFeature USE_LONG_FOR_INTS

Feature that determines how "small" JSON integral (non-floating-point) numbers -- ones that fit in 32-bit signed integer (`int`) -- are bound when target type is loosely typed as Object or Number (or within untyped java.util.Map or java.util.Collection context). If enabled, such values will be deserialized as java.lang.Long; if disabled, they will be deserialized as "smallest" available type, Integer.

Note

if USE_BIG_INTEGER_FOR_INTS is enabled, it has precedence over this setting, forcing use of java.math.BigInteger for all integral values.

Feature is disabled by default, meaning that "untyped" integral numbers will by default be deserialized using java.lang.Integer if value fits.

Since
2.6
WRAP_EXCEPTIONSback to summary
public static final DeserializationFeature WRAP_EXCEPTIONS

Feature that determines whether Jackson code should catch and wrap Exceptions (but never Errors!) 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 java.io.IOExceptions 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.

Note

most of the time exceptions that may or may not be wrapped are of type RuntimeException: as mentioned earlier, various java.io.IOExceptions (and in particular com.fasterxml.jackson.core.JacksonExceptions) will always be passed as-is.

Disabling this feature will mean that you will need to adjust your try/catch blocks to properly handle RuntimeExceptions. Failing to do so, may cause your application to crash due to unhandled exceptions.

Feature is enabled by default.

Constructor Detail

DeserializationFeatureback to summary
private DeserializationFeature(boolean defaultState)

Method Detail

enabledByDefaultback to summary
public boolean enabledByDefault()

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledByDefault.

Doc from com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

Annotations
@Override
enabledInback to summary
public boolean enabledIn(int flags)

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledIn.

Doc from com.fasterxml.jackson.databind.cfg.ConfigFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask

Annotations
@Override
getMaskback to summary
public int getMask()

Implements com.fasterxml.jackson.databind.cfg.ConfigFeature.getMask.

Doc from com.fasterxml.jackson.databind.cfg.ConfigFeature.getMask.

Returns bit mask for this feature instance

Annotations
@Override
valueOfback to summary
public static DeserializationFeature valueOf(String name)
valuesback to summary
public static DeserializationFeature[] values()