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 3.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 ( |
| 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 | 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_READING_DUP_TREE_KEY
Feature that determines what happens when reading JSON content into tree
( |
| public static final DeserializationFeature | FAIL_ON_SUBTYPE_CLASS_NOT_REGISTERED
Feature that determines behavior when deserializing polymorphic types that use
Class-based Type Id mechanism (either
|
| public static final DeserializationFeature | FAIL_ON_TRAILING_TOKENS
Feature that determines behavior 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_INJECT_VALUE
Feature that determines the handling of injected properties 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 | 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 non-Jackson |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | enabledByDefault()
Implements tools. Accessor for checking whether this feature is enabled by default. |
| public boolean | enabledIn(int flags)
Implements tools. Convenience method for checking whether feature is enabled in given bitmask |
| public int | getMask()
Implements tools. 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 ( Note this does NOT apply to scalar values such as Strings, 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. | |
| 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 | |
| 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 enabled by default as of Jackson 3.0 (in 2.x it was disabled). | |
| 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_SUBTYPE_CLASS_NOT_REGISTERED | back to summary |
|---|---|
| public static final DeserializationFeature FAIL_ON_SUBTYPE_CLASS_NOT_REGISTERED Feature that determines behavior when deserializing polymorphic types that use
Class-based Type Id mechanism (either
Note that for Type Name - based Type Id mechanism ( Feature is disabled by default. | |
| FAIL_ON_TRAILING_TOKENS | back to summary |
|---|---|
| public static final DeserializationFeature FAIL_ON_TRAILING_TOKENS Feature that determines behavior for data-binding after binding the root value.
If feature is enabled, one more call to
Feature could alternatively be called Note this feature should usually be disabled when reading from
Feature is enabled by default as of Jackson 3.0 (in 2.x it was disabled). | |
| 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 can enhance 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. Feature is disabled by default to maintain backward compatibility. | |
| FAIL_ON_UNKNOWN_INJECT_VALUE | back to summary |
|---|---|
| public static final DeserializationFeature FAIL_ON_UNKNOWN_INJECT_VALUE Feature that determines the handling of injected properties during deserialization.
When enabled, if an injected property without matching value is encountered
during deserialization, an exception is thrown.
When disabled, no exception is thrown.
See This feature is enabled by default to maintain backwards-compatibility.
| |
| 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 disabled by default as of Jackson 3.0 (in 2.x it was enabled). | |
| 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. | |
| 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 related 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 non-Jackson 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 tools. Doc from tools. Accessor for checking whether this feature is enabled by default.
| |
| enabledIn | back to summary |
|---|---|
| public boolean enabledIn(int flags) Implements tools. Doc from tools. Convenience method for checking whether feature is enabled in given bitmask
| |
| getMask | back to summary |
|---|---|
| public int getMask() Implements tools. Doc from tools. 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() | |