Enum CBORParser.Feature
- java.lang.Object
-
- java.lang.Enum<CBORParser.Feature>
-
- com.fasterxml.jackson.dataformat.cbor.CBORParser.Feature
-
- All Implemented Interfaces:
com.fasterxml.jackson.core.FormatFeature,com.fasterxml.jackson.core.util.JacksonFeature,java.io.Serializable,java.lang.Comparable<CBORParser.Feature>
- Enclosing class:
- CBORParser
public static enum CBORParser.Feature extends java.lang.Enum<CBORParser.Feature> implements com.fasterxml.jackson.core.FormatFeature
Enumeration that defines all togglable features for CBOR generators.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DECODE_USING_STANDARD_NEGATIVE_BIGINT_ENCODINGFeature 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).READ_SIMPLE_VALUE_AS_EMBEDDED_OBJECTFeature that determines how a CBOR "simple value" of major type 7 is exposed by parser.READ_UNDEFINED_AS_EMBEDDED_OBJECTFeature that determines how anundefinedvalue (0xF7) is exposed by parser.
-
Field Summary
Fields Modifier and Type Field Description private boolean_defaultStateprivate int_mask
-
Constructor Summary
Constructors Modifier Constructor Description privateFeature(boolean defaultState)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcollectDefaults()Method that calculates bit set (flags) of all features that are enabled by default.booleanenabledByDefault()booleanenabledIn(int flags)intgetMask()static CBORParser.FeaturevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CBORParser.Feature[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DECODE_USING_STANDARD_NEGATIVE_BIGINT_ENCODING
public static final CBORParser.Feature 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 backwards compatibility with existing implementations (e.g.,[0xC3, 0x41, 0x00]is decoded as 0).Note that there is the counterpart
CBORGenerator.Feature.ENCODE_USING_STANDARD_NEGATIVE_BIGINT_ENCODINGfor encoding.The default value is
falsefor backwards compatibility.- Since:
- 2.20
-
READ_UNDEFINED_AS_EMBEDDED_OBJECT
public static final CBORParser.Feature READ_UNDEFINED_AS_EMBEDDED_OBJECT
Feature that determines how anundefinedvalue (0xF7) is exposed by parser.When enabled, the parser returns
JsonToken.VALUE_EMBEDDED_OBJECTwith a value ofnull, allowing the caller to distinguishundefinedfrom actualJsonToken.VALUE_NULL. When disabledundefinedvalue is reported asJsonToken.VALUE_NULL.The default value is
falsefor backwards compatibility (with versions prior to 2.20).- Since:
- 2.20
-
READ_SIMPLE_VALUE_AS_EMBEDDED_OBJECT
public static final CBORParser.Feature 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_OBJECTwith an embedded value of typeCBORSimpleValue, allowing the caller to distinguish these values from actualJsonToken.VALUE_NUMBER_INTs. When disabled, simple values are returned asJsonToken.VALUE_NUMBER_INT.The default value is
falsefor backwards compatibility (with versions prior to 2.20).- Since:
- 2.20
-
-
Method Detail
-
values
public static CBORParser.Feature[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CBORParser.Feature c : CBORParser.Feature.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CBORParser.Feature valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.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:
enabledByDefaultin interfacecom.fasterxml.jackson.core.FormatFeature- Specified by:
enabledByDefaultin interfacecom.fasterxml.jackson.core.util.JacksonFeature
-
getMask
public int getMask()
- Specified by:
getMaskin interfacecom.fasterxml.jackson.core.FormatFeature- Specified by:
getMaskin interfacecom.fasterxml.jackson.core.util.JacksonFeature
-
enabledIn
public boolean enabledIn(int flags)
- Specified by:
enabledInin interfacecom.fasterxml.jackson.core.FormatFeature- Specified by:
enabledInin interfacecom.fasterxml.jackson.core.util.JacksonFeature
-
-