Interface DeserializationConfiguration


public interface DeserializationConfiguration
Configuration for deserialization.
  • Field Details

  • Method Details

    • isIgnoreUnknown

      @Bindable(defaultValue="true") boolean isIgnoreUnknown()
      Whether to ignore unknown values during deserialization.
      Returns:
      True if unknown values should simply be ignored.
    • getArraySizeThreshold

      @Bindable(defaultValue="100") int getArraySizeThreshold()
      Returns:
      The array size thresh hold for use in binding. Defaults to 100.
    • isStrictNullable

      @Bindable(defaultValue="false") boolean isStrictNullable()
      Whether null field should be annotated with a nullable annotations. Defaults to false
      Returns:
      True if null field should be annotated with a nullable annotations
    • isFailOnNullForPrimitives

      @Bindable(defaultValue="true") default boolean isFailOnNullForPrimitives()
      Whether a null field for a primitive should fail the deserialization. Defaults to true
      Returns:
      True if a null field for a primitive should fail the deserialization
    • isSubtypesRequireDefaultImpl

      @Bindable(defaultValue="true") default boolean isSubtypesRequireDefaultImpl()
      Whether the supertype is used by default when no supertype is resolved.
      Returns:
      True to avoid the supertype and use `defaultImpl` property
    • acceptCaseInsensitiveEnums

      @Bindable(defaultValue="false") default boolean acceptCaseInsensitiveEnums()
      Determines whether to accept case-insensitive enumeration values during deserialization. By default, case-insensitive enums are not accepted.
      Returns:
      true if case-insensitive enumeration values are accepted; false otherwise
      Since:
      2.15.2
    • acceptSingleValueAsArray

      @Bindable(defaultValue="false") default boolean acceptSingleValueAsArray()
      Determines whether scalar values can be accepted as single-element arrays.
      Returns:
      true if scalar values can be read as arrays
      Since:
      3.0
    • acceptCaseInsensitiveProperties

      @Bindable(defaultValue="false") default boolean acceptCaseInsensitiveProperties()
      Determines whether properties should be matched case-insensitively.
      Returns:
      true if property names are case-insensitive
      Since:
      3.0
    • readUnknownEnumValuesAsNull

      @Bindable(defaultValue="false") default boolean readUnknownEnumValuesAsNull()
      Determines whether unknown enum values should deserialize as null.
      Returns:
      true if unknown enum values should deserialize as null
      Since:
      3.0
    • readUnknownEnumValuesUsingDefaultValue

      @Bindable(defaultValue="false") default boolean readUnknownEnumValuesUsingDefaultValue()
      Determines whether unknown enum values should use the configured default enum value.
      Returns:
      true if unknown enum values should use the default enum value
      Since:
      3.0
    • readDateTimestampsAsNanoseconds

      @Bindable(defaultValue="true") default boolean readDateTimestampsAsNanoseconds()
      Determines whether numeric timestamps are read with nanosecond precision.
      Returns:
      true if numeric timestamps use nanoseconds
      Since:
      3.0
    • adjustDatesToContextTimeZone

      @Bindable(defaultValue="false") default boolean adjustDatesToContextTimeZone()
      Determines whether temporal values are adjusted to the configured context time zone.
      Returns:
      true if dates should be adjusted to the context time zone
      Since:
      3.0
    • isRequireAllCreatorParameters

      @Bindable(defaultValue="false") default boolean isRequireAllCreatorParameters()
      Determines whether every creator parameter must be present in the JSON input.
      Returns:
      true if all creator parameters are required
      Since:
      3.1.0
    • disableGeneratedDeserializer

      @Bindable(defaultValue="false") default boolean disableGeneratedDeserializer()
      Determines whether generated deserializers should fall back to the runtime deserializer.
      Returns:
      true if generated deserializers should be disabled
      Since:
      3.0
    • getCoercionMode

      @Bindable(defaultValue="LENIENT") default CoercionMode getCoercionMode()
      The baseline for the scalar coercions the decoders perform. Defaults to CoercionMode.LENIENT for backwards compatibility. Setting this to CoercionMode.STRICT turns off every coercion that is not configured explicitly.
      Returns:
      The coercion mode
      Since:
      3.2
    • isAcceptFloatAsInt

      @Bindable(defaultValue="true") default boolean isAcceptFloatAsInt()
      Whether floating-point JSON numbers should be read into integer properties, truncating them.
      Returns:
      true if floating-point values should be accepted as integers
      Since:
      3.2
    • isAcceptStringAsNumber

      @Bindable(defaultValue="true") default boolean isAcceptStringAsNumber()
      Whether JSON strings should be read into numeric properties.
      Returns:
      true if strings should be accepted as numbers
      Since:
      3.2
    • isAcceptBooleanAsNumber

      @Bindable(defaultValue="true") default boolean isAcceptBooleanAsNumber()
      Whether JSON booleans should be read into numeric properties, true as 1 and false as 0.
      Returns:
      true if booleans should be accepted as numbers
      Since:
      3.2
    • isAcceptNumberAsBoolean

      @Bindable(defaultValue="true") default boolean isAcceptNumberAsBoolean()
      Whether JSON numbers should be read into boolean properties, any non-zero value as true.
      Returns:
      true if numbers should be accepted as booleans
      Since:
      3.2
    • isAcceptStringAsBoolean

      @Bindable(defaultValue="true") default boolean isAcceptStringAsBoolean()
      Whether JSON strings should be read into boolean properties.
      Returns:
      true if strings should be accepted as booleans
      Since:
      3.2
    • isAcceptScalarAsString

      @Bindable(defaultValue="true") default boolean isAcceptScalarAsString()
      Whether JSON numbers and booleans should be read into string properties.
      Returns:
      true if other scalars should be accepted as strings
      Since:
      3.2
    • isUnwrapSingleValueArrays

      @Bindable(defaultValue="true") default boolean isUnwrapSingleValueArrays()
      Whether a single element JSON array should be read into a scalar property, unwrapping it. Note that this is the opposite direction of acceptSingleValueAsArray().
      Returns:
      true if single element arrays should be unwrapped
      Since:
      3.2
    • features

      Returns the active format features for deserialization.
      Returns:
      The active format features for deserialization.
      Since:
      3.0
    • features

      static Set<DeserializationConfiguration.Feature> features(@Nullable DeserializationConfiguration configuration)
      Resolve the active format features for the given deserialization configuration.
      Parameters:
      configuration - The deserialization configuration
      Returns:
      The active format features
      Since:
      3.0