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.
| Modifier and Type | Field 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, |
| 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 ( |
| 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 |
| public static final DeserializationFeature | EAGER_DESERIALIZER_FETCH
Feature that determines whether |
| 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,
|
| public static final DeserializationFeature | FAIL_ON_INVALID_SUBTYPE
Feature that determines what happens when type of a polymorphic
value (indicated for example by |
| 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
|
| 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
( |
| 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
|
| 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 |
| 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 |
| public static final DeserializationFeature | READ_UNKNOWN_ENUM_VALUES_AS_NULL
Feature that allows unknown Enum values to be parsed as |
| 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
|
| public static final DeserializationFeature | UNWRAP_ROOT_VALUE
Feature to allow "unwrapping" root-level JSON value, to match setting of
|
| 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 |
| public static final DeserializationFeature | USE_BIG_INTEGER_FOR_INTS
Feature that determines whether JSON integral (non-floating-point)
numbers are to be deserialized into |
| public static final DeserializationFeature | USE_JAVA_ARRAY_FOR_JSON_ARRAY
Feature that determines whether JSON Array is mapped to
|
| 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 |
| public static final DeserializationFeature | WRAP_EXCEPTIONS
Feature that determines whether Jackson code should catch
and wrap |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | enabledByDefault()
Implements com. Accessor for checking whether this feature is enabled by default. |
| public boolean | enabledIn(int flags)
Implements com. Convenience method for checking whether feature is enabled in given bitmask |
| public int | getMask()
Implements com. Returns bit mask for this feature instance |
| public static DeserializationFeature | |
| public static DeserializationFeature[] |
| _defaultState | back to summary |
|---|---|
| private final boolean _defaultState | |
| _mask | back to summary |
|---|---|
| private final int _mask | |
| ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT | back 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, Feature is disabled by default.
| |
| ACCEPT_EMPTY_STRING_AS_NULL_OBJECT | back 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 ( Note this does NOT apply to scalar values such as booleans, numbers
and date/time types;
whether these can be coerced depends on
Feature is disabled by default. | |
| ACCEPT_FLOAT_AS_INT | back 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 Feature is enabled by default.
| |
| ACCEPT_SINGLE_VALUE_AS_ARRAY | back 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_ZONE | back to summary |
|---|---|
| public static final DeserializationFeature ADJUST_DATES_TO_CONTEXT_TIME_ZONE Feature that specifies whether context provided
Note that exact behavior depends on date/time types in question; and specifically
JDK type of
Taking above into account, this feature is supported only by extension modules for Joda and Java 8 date/time datatypes.
| |
| EAGER_DESERIALIZER_FETCH | back to summary |
|---|---|
| public static final DeserializationFeature EAGER_DESERIALIZER_FETCH Feature that determines whether 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.
| |
| FAIL_ON_IGNORED_PROPERTIES | back 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,
Feature is disabled by default so that no exception is thrown.
| |
| FAIL_ON_INVALID_SUBTYPE | back 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 Feature is enabled by default so that exception is thrown for missing or invalid type information.
| |
| FAIL_ON_MISSING_CREATOR_PROPERTIES | back 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 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`.
| |
| FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY | back to summary |
|---|---|
| public static final DeserializationFeature FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY Feature that determines what happens when a property annotated with
Feature is enabled by default, so that exception is thrown when a subtype property is missing.
| |
| FAIL_ON_NULL_CREATOR_PROPERTIES | back 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`.
| |
| FAIL_ON_NULL_FOR_PRIMITIVES | back 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 Feature is disabled by default. | |
| FAIL_ON_NUMBERS_FOR_ENUMS | back 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 Feature is disabled by default. | |
| FAIL_ON_READING_DUP_TREE_KEY | back to summary |
|---|---|
| public static final DeserializationFeature FAIL_ON_READING_DUP_TREE_KEY Feature that determines what happens when reading JSON content into tree
(
Note that this property does NOT affect other aspects of data-binding; that is,
no detection is done with respect to POJO properties or Feature is disabled by default so that no exception is thrown.
| |
| FAIL_ON_TRAILING_TOKENS | back 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
Feature could alternatively be called Feature is disabled by default (so that no check is made for possible trailing token(s)) for backwards compatibility reasons.
| |
| FAIL_ON_UNEXPECTED_VIEW_PROPERTIES | back 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 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.
| |
| FAIL_ON_UNKNOWN_PROPERTIES | back 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
Feature is enabled by default (meaning that a
| |
| FAIL_ON_UNRESOLVED_OBJECT_IDS | back 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 Feature is enabled by default, so that unknown Object Ids will result in an exception being thrown, at the end of deserialization.
| |
| READ_DATE_TIMESTAMPS_AS_NANOSECONDS | back 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 Feature is enabled by default, to support most accurate time values possible.
| |
| READ_ENUMS_USING_TO_STRING | back 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 Note this feature should usually have same value
as Feature is disabled by default. | |
| READ_UNKNOWN_ENUM_VALUES_AS_NULL | back to summary |
|---|---|
| public static final DeserializationFeature READ_UNKNOWN_ENUM_VALUES_AS_NULL Feature that allows unknown Enum values to be parsed as
Note that in some cases this will effectively ignore unknown
Also note that this feature has lower precedence than
Feature is disabled by default.
| |
| READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE | back 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
Note that this feature has higher precedence than Feature is disabled by default.
| |
| UNWRAP_ROOT_VALUE | back to summary |
|---|---|
| public static final DeserializationFeature UNWRAP_ROOT_VALUE Feature to allow "unwrapping" root-level JSON value, to match setting of
Feature is disabled by default. | |
| UNWRAP_SINGLE_VALUE_ARRAYS | back 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 Note only single wrapper Array is allowed: if multiple attempted, exception will be thrown. Feature is disabled by default.
| |
| USE_BIG_DECIMAL_FOR_FLOATS | back to summary |
|---|---|
| public static final DeserializationFeature USE_BIG_DECIMAL_FOR_FLOATS Feature that determines whether JSON floating point numbers
are to be deserialized into Note one aspect of
Feature is disabled by default, meaning that "untyped" floating
point numbers will by default be deserialized as | |
| USE_BIG_INTEGER_FOR_INTS | back 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 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_ARRAY | back to summary |
|---|---|
| public static final DeserializationFeature USE_JAVA_ARRAY_FOR_JSON_ARRAY Feature that determines whether JSON Array is mapped to
Feature is disabled by default, meaning that JSON arrays are bound as
| |
| USE_LONG_FOR_INTS | back 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 Note if
Feature is disabled by default, meaning that "untyped" integral
numbers will by default be deserialized using
| |
| WRAP_EXCEPTIONS | back to summary |
|---|---|
| public static final DeserializationFeature WRAP_EXCEPTIONS Feature that determines whether Jackson code should catch
and wrap Note most of the time exceptions that may or may not be wrapped are of
type
Disabling this feature will mean that you will need to adjust your try/catch
blocks to properly handle Feature is enabled by default. | |
| DeserializationFeature | back to summary |
|---|---|
| private DeserializationFeature(boolean defaultState) | |
| enabledByDefault | back to summary |
|---|---|
| public boolean enabledByDefault() Implements com. Doc from com. Accessor for checking whether this feature is enabled by default.
| |
| enabledIn | back to summary |
|---|---|
| public boolean enabledIn(int flags) Implements com. Doc from com. Convenience method for checking whether feature is enabled in given bitmask
| |
| getMask | back to summary |
|---|---|
| public int getMask() Implements com. Doc from com. Returns bit mask for this feature instance
| |
| valueOf | back to summary |
|---|---|
| public static DeserializationFeature valueOf(String name) | |
| values | back to summary |
|---|---|
| public static DeserializationFeature[] values() | |