Enum Class CBORReadFeature

java.lang.Object
java.lang.Enum<CBORReadFeature>
tools.jackson.dataformat.cbor.CBORReadFeature
All Implemented Interfaces:
Serializable, Comparable<CBORReadFeature>, Constable, tools.jackson.core.FormatFeature, tools.jackson.core.util.JacksonFeature

public enum CBORReadFeature extends Enum<CBORReadFeature> implements tools.jackson.core.FormatFeature
Enumeration that defines all togglable features for CBOR parser.

NOTE: in Jackson 2.x this was named CBORParser.Feature.

  • Enum Constant Details

    • DECODE_USING_STANDARD_NEGATIVE_BIGINT_ENCODING

      public static final CBORReadFeature DECODE_USING_STANDARD_NEGATIVE_BIGINT_ENCODING
      Feature that determines how binary tagged negative BigInteger values are decoded: either assuming CBOR standard encoding logic (as per spec), or the legacy Jackson encoding logic (encoding up to Jackson 2.19). When enabled, ensures proper encoding of negative values (e.g., [0xC3, 0x41, 0x00] is decoded as -1) When disabled, maintains compatible behavior to versions prior to 3.0. (e.g., [0xC3, 0x41, 0x00] is decoded as 0).

      Note that there is the counterpart CBORWriteFeature.ENCODE_USING_STANDARD_NEGATIVE_BIGINT_ENCODING for encoding.

      The default value is true in Jackson 3.x (was false in Jackson 2.x).

    • READ_UNDEFINED_AS_EMBEDDED_OBJECT

      public static final CBORReadFeature READ_UNDEFINED_AS_EMBEDDED_OBJECT
      Feature that determines how an undefined value (0xF7) is exposed by parser.

      When enabled, the parser returns JsonToken.VALUE_EMBEDDED_OBJECT with a value of null, allowing the caller to distinguish undefined from actual JsonToken.VALUE_NULL. When disabled, undefined value is reported as simple JsonToken.VALUE_NULL.

      The default value is true in Jackson 3.x (was false in Jackson 2.x).

    • READ_SIMPLE_VALUE_AS_EMBEDDED_OBJECT

      public static final CBORReadFeature READ_SIMPLE_VALUE_AS_EMBEDDED_OBJECT
      Feature that determines how a CBOR "simple value" of major type 7 is exposed by parser.

      When enabled, the parser returns JsonToken.VALUE_EMBEDDED_OBJECT with an embedded value of type CBORSimpleValue, allowing the caller to distinguish these values from actual JsonToken.VALUE_NUMBER_INTs. When disabled, simple values are returned as JsonToken.VALUE_NUMBER_INTs.

      The default value is true in Jackson 3.x (was false in Jackson 2.x).

  • Field Details

    • _defaultState

      private final boolean _defaultState
    • _mask

      private final int _mask
  • Constructor Details

    • CBORReadFeature

      private CBORReadFeature(boolean defaultState)
  • Method Details

    • values

      public static CBORReadFeature[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CBORReadFeature valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • collectDefaults

      public static int collectDefaults()
      Method that calculates bit set (flags) of all features that are enabled by default.
    • enabledByDefault

      public boolean enabledByDefault()
      Specified by:
      enabledByDefault in interface tools.jackson.core.util.JacksonFeature
    • enabledIn

      public boolean enabledIn(int flags)
      Specified by:
      enabledIn in interface tools.jackson.core.util.JacksonFeature
    • getMask

      public int getMask()
      Specified by:
      getMask in interface tools.jackson.core.util.JacksonFeature