Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CommonFeature

Interface that defines common features to set for ObjectMapper, JsonParser and JsonStringifier.

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

Hierarchy

Index

Properties

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 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 "".

Generated using TypeDoc