Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DeserializationFeature

Interface that defines features to set for ObjectMapper and JsonParser.

Changes only take effect when done before any deserialization calls -- that is, caller must follow "configure-then-use" pattern.

Hierarchy

Index

Properties

Optional ACCEPT_CASE_INSENSITIVE_PROPERTIES

ACCEPT_CASE_INSENSITIVE_PROPERTIES: boolean

Feature that will allow for more forgiving deserialization of incoming JSON. If enabled, the class properties will be matched using their lower-case equivalents, meaning that any case-combination (incoming and matching names are canonicalized by lower-casing) should work.

Optional ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT

ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT: boolean

Feature that can be enabled to allow empty JSON Array value (that is, []) to be bound to JavaScript as null.

Optional ACCEPT_EMPTY_STRING_AS_NULL_OBJECT

ACCEPT_EMPTY_STRING_AS_NULL_OBJECT: boolean

Feature that can be enabled to allow JSON empty String value ("") to be bound as null.

Optional ALLOW_COERCION_OF_SCALARS

ALLOW_COERCION_OF_SCALARS: boolean

Feature that determines whether coercions from secondary representations are allowed for simple non-textual scalar types: numbers and booleans.

When feature is enabled, conversions from JSON String are allowed, as long as textual value matches (for example, String "true" is allowed as equivalent of JSON boolean token true; or String "1.5" for Number).

Optional DEFAULT_VIEW_INCLUSION

DEFAULT_VIEW_INCLUSION: boolean

Feature that determines whether properties that have no view decorators are included in JSON serialization views (see JsonView for more details on JSON Views).

If enabled, non-decorated properties will be included; when disabled, they will be excluded. So this feature changes between "opt-in" (feature disabled) and "opt-out" (feature enabled) modes.

Default value is enabled, meaning that non-decorated properties are included in all views if there is no JsonView decorator.

Optional FAIL_ON_INVALID_SUBTYPE

FAIL_ON_INVALID_SUBTYPE: boolean

Feature that determines what happens when type of a polymorphic value (indicated for example by JsonTypeInfo) cannot be found (missing) or resolved (invalid class name, unmappable id). If enabled, a JacksonError is thrown; if disabled, the type will be based on the context.

Optional FAIL_ON_MISSING_CREATOR_PROPERTIES

FAIL_ON_MISSING_CREATOR_PROPERTIES: boolean

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 JacksonError being thrown with information on the first one (by index) of missing properties.

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

Optional FAIL_ON_MISSING_TYPE_ID

FAIL_ON_MISSING_TYPE_ID: boolean

Feature that determines what happens when a type id is missing from the JSON Object when trying to resolve type or subtype of a class decorated with JsonTypeInfo and using JsonTypeInfoAs.PROPERTY as {@link JsonTypeInfoOptions.include} option value. If enabled, a JacksonError is thrown when type id is missing; if disabled, the type will be based on the context.

Optional FAIL_ON_NULL_CREATOR_PROPERTIES

FAIL_ON_NULL_CREATOR_PROPERTIES: boolean

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. If enabled, such null values result in a JacksonError being thrown with information on the first one (by index) of null values.

Optional FAIL_ON_NULL_FOR_PRIMITIVES

FAIL_ON_NULL_FOR_PRIMITIVES: boolean

Feature that determines whether encountering of JSON null is an error when deserializing into JavaScript primitive types: Number, String, Boolean, BigInt and Symbol. If it is, a JacksonError is thrown to indicate this.

Optional FAIL_ON_UNKNOWN_PROPERTIES

FAIL_ON_UNKNOWN_PROPERTIES: boolean

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 JacksonError) or not. This setting only takes effect after all other handling methods for unknown properties have been tried, and property remains unhandled.

Optional FAIL_ON_UNRESOLVED_OBJECT_IDS

FAIL_ON_UNRESOLVED_OBJECT_IDS: boolean

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"). If enabled, a JacksonError is thrown at the end of deserialization; if disabled, a null object is used instead. 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.

Optional SET_DEFAULT_VALUE_FOR_BIGINT_ON_NULL

SET_DEFAULT_VALUE_FOR_BIGINT_ON_NULL: boolean

Feature that determines whether BigInt primitive type properties that contains null value should be serialized/deserialized with its default value or not. If enabled, during serialization, the property will be serialized with its default value. Instead, during deserialization, the null value will be substituted with its default value.

The default BigInt value is 0n.

Optional SET_DEFAULT_VALUE_FOR_BOOLEAN_ON_NULL

SET_DEFAULT_VALUE_FOR_BOOLEAN_ON_NULL: boolean

Feature that determines whether Boolean primitive type properties that contains null value should be serialized/deserialized with its default value or not. If enabled, during serialization, the property will be serialized with its default value. Instead, during deserialization, the null value will be substituted with its default value.

The default Boolean value is false.

Optional SET_DEFAULT_VALUE_FOR_NUMBER_ON_NULL

SET_DEFAULT_VALUE_FOR_NUMBER_ON_NULL: boolean

Feature that determines whether Number primitive type properties that contains null value should be serialized/deserialized with its default value or not. If enabled, during serialization, the property will be serialized with its default value. Instead, during deserialization, the null value will be substituted with its default value.

The default Number value is 0.

Optional SET_DEFAULT_VALUE_FOR_PRIMITIVES_ON_NULL

SET_DEFAULT_VALUE_FOR_PRIMITIVES_ON_NULL: boolean

Feature that determines whether primitive type properties that contains null value should be serialized/deserialized with its default value or not. If enabled, during serialization, the property will be serialized with its default value. Instead, during deserialization, the null value will be substituted with its default value.

Default values are:

  • Number: 0;
  • String: "";
  • Boolean: false;
  • BigInt: 0n;
  • null for all other JavaScript types.

Optional SET_DEFAULT_VALUE_FOR_STRING_ON_NULL

SET_DEFAULT_VALUE_FOR_STRING_ON_NULL: boolean

Feature that determines whether String primitive type properties that contains null value should be serialized/deserialized with its default value or not. If enabled, during serialization, the property will be serialized with its default value. Instead, during deserialization, the null value will be substituted with its default value.

The default String value is "".

Optional UNWRAP_ROOT_VALUE

UNWRAP_ROOT_VALUE: boolean

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 JacksonError is thrown; otherwise value of the wrapped property will be deserialized as if it was the root value.

Generated using TypeDoc