- All Implemented Interfaces:
Serializable,Comparable<TokenStreamFactory.Feature>,Constable,JacksonFeature
- Enclosing class:
- TokenStreamFactory
public static enum TokenStreamFactory.Feature
extends Enum<TokenStreamFactory.Feature>
implements JacksonFeature
Enumeration that defines all on/off features that can only be
changed for
TokenStreamFactory.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFeature that determines whether JSON object property names are to be canonicalized (details of how canonicalization is done then further specified byINTERN_PROPERTY_NAMES).Feature to control charset detection for byte-based inputs (byte[],InputStream...).Feature that determines what happens if we encounter a case in symbol handling where number of hash collisions exceeds a safety threshold -- which almost certainly means a denial-of-service attack via generated duplicate hash codes.Feature that determines whether JSON object property names are to be canonicalized usingString.intern()or not: if enabled, all property names will be intern()ed (and caller can count on this being true for all such names); if disabled, no intern()ing is done. -
Method Summary
Modifier and TypeMethodDescriptionstatic intMethod that calculates bit set (flags) of all features that are enabled by default.booleanAccessor for checking whether this feature is enabled by default.booleanenabledIn(int flags) Convenience method for checking whether feature is enabled in given bitmask.intgetMask()Returns bit mask for this feature instance; must be a single bit, that is of form1 << N.static TokenStreamFactory.FeatureReturns the enum constant of this class with the specified name.static TokenStreamFactory.Feature[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INTERN_PROPERTY_NAMES
Feature that determines whether JSON object property names are to be canonicalized usingString.intern()or not: if enabled, all property names will be intern()ed (and caller can count on this being true for all such names); if disabled, no intern()ing is done. There may still be basic canonicalization (that is, same String will be used to represent all identical object property names for a single document).Note: this setting only has effect if
CANONICALIZE_PROPERTY_NAMESis true -- otherwise no canonicalization of any sort is done.This setting is disabled by default since 3.0 (was enabled in 1.x and 2.x)
-
CANONICALIZE_PROPERTY_NAMES
Feature that determines whether JSON object property names are to be canonicalized (details of how canonicalization is done then further specified byINTERN_PROPERTY_NAMES).This setting is enabled by default.
-
FAIL_ON_SYMBOL_HASH_OVERFLOW
Feature that determines what happens if we encounter a case in symbol handling where number of hash collisions exceeds a safety threshold -- which almost certainly means a denial-of-service attack via generated duplicate hash codes. If feature is enabled, anIllegalStateExceptionis thrown to indicate the suspected denial-of-service attack; if disabled, processing continues but canonicalization (and therebyintern()ing) is disabled) as protective measure.This setting is enabled by default.
-
CHARSET_DETECTION
Feature to control charset detection for byte-based inputs (byte[],InputStream...). When this feature is enabled (the default), the factory will allow UTF-16 and UTF-32 inputs and try to detect them, as specified by RFC 4627. When this feature is disabled the factory will assume UTF-8, as specified by RFC 8259.NOTE: only applies to some implementations: most notable for
JsonFactory.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
collectDefaults
public static int collectDefaults()Method that calculates bit set (flags) of all features that are enabled by default.- Returns:
- Bit mask of all features that are enabled by default
-
enabledByDefault
public boolean enabledByDefault()Description copied from interface:JacksonFeatureAccessor for checking whether this feature is enabled by default.- Specified by:
enabledByDefaultin interfaceJacksonFeature- Returns:
- Whether this instance is enabled by default or not
-
enabledIn
public boolean enabledIn(int flags) Description copied from interface:JacksonFeatureConvenience method for checking whether feature is enabled in given bitmask.- Specified by:
enabledInin interfaceJacksonFeature- Parameters:
flags- Bitfield that contains a set of enabled features of this type- Returns:
- True if this feature is enabled in passed bit field
-
getMask
public int getMask()Description copied from interface:JacksonFeatureReturns bit mask for this feature instance; must be a single bit, that is of form1 << N.- Specified by:
getMaskin interfaceJacksonFeature- Returns:
- Bit mask of this feature
-