Package com.alibaba.fastjson2
Enum JSONReader.Feature
- java.lang.Object
-
- java.lang.Enum<JSONReader.Feature>
-
- com.alibaba.fastjson2.JSONReader.Feature
-
- All Implemented Interfaces:
Serializable,Comparable<JSONReader.Feature>
- Enclosing class:
- JSONReader
public static enum JSONReader.Feature extends Enum<JSONReader.Feature>
-
-
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description longmask
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEnabled(long features)static booleanisEnabled(long features, JSONReader.Feature feature)static longof(JSONReader.Feature[] features)static JSONReader.FeaturevalueOf(String name)Returns the enum constant of this type with the specified name.static JSONReader.Feature[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FieldBased
public static final JSONReader.Feature FieldBased
-
IgnoreNoneSerializable
public static final JSONReader.Feature IgnoreNoneSerializable
-
ErrorOnNoneSerializable
public static final JSONReader.Feature ErrorOnNoneSerializable
- Since:
- 2.0.14
-
SupportArrayToBean
public static final JSONReader.Feature SupportArrayToBean
-
InitStringFieldAsEmpty
public static final JSONReader.Feature InitStringFieldAsEmpty
-
SupportAutoType
@Deprecated public static final JSONReader.Feature SupportAutoType
Deprecated.It is not safe to explicitly turn on autoType, it is recommended to use AutoTypeBeforeHandler
-
SupportSmartMatch
public static final JSONReader.Feature SupportSmartMatch
-
UseNativeObject
public static final JSONReader.Feature UseNativeObject
-
SupportClassForName
public static final JSONReader.Feature SupportClassForName
-
IgnoreSetNullValue
public static final JSONReader.Feature IgnoreSetNullValue
-
UseDefaultConstructorAsPossible
public static final JSONReader.Feature UseDefaultConstructorAsPossible
-
UseBigDecimalForFloats
public static final JSONReader.Feature UseBigDecimalForFloats
-
UseBigDecimalForDoubles
public static final JSONReader.Feature UseBigDecimalForDoubles
-
ErrorOnEnumNotMatch
public static final JSONReader.Feature ErrorOnEnumNotMatch
-
TrimString
public static final JSONReader.Feature TrimString
-
ErrorOnNotSupportAutoType
public static final JSONReader.Feature ErrorOnNotSupportAutoType
-
DuplicateKeyValueAsArray
public static final JSONReader.Feature DuplicateKeyValueAsArray
-
AllowUnQuotedFieldNames
public static final JSONReader.Feature AllowUnQuotedFieldNames
-
NonStringKeyAsString
public static final JSONReader.Feature NonStringKeyAsString
-
Base64StringAsByteArray
public static final JSONReader.Feature Base64StringAsByteArray
- Since:
- 2.0.13
-
IgnoreCheckClose
public static final JSONReader.Feature IgnoreCheckClose
- Since:
- 2.0.16
-
ErrorOnNullForPrimitives
public static final JSONReader.Feature ErrorOnNullForPrimitives
- Since:
- 2.0.20
-
NullOnError
public static final JSONReader.Feature NullOnError
- Since:
- 2.0.20
-
IgnoreAutoTypeNotMatch
public static final JSONReader.Feature IgnoreAutoTypeNotMatch
- Since:
- 2.0.21
-
NonZeroNumberCastToBooleanAsTrue
public static final JSONReader.Feature NonZeroNumberCastToBooleanAsTrue
- Since:
- 2.0.24
-
IgnoreNullPropertyValue
public static final JSONReader.Feature IgnoreNullPropertyValue
- Since:
- 2.0.40
-
ErrorOnUnknownProperties
public static final JSONReader.Feature ErrorOnUnknownProperties
- Since:
- 2.0.42
-
EmptyStringAsNull
public static final JSONReader.Feature EmptyStringAsNull
empty string "" convert to null- Since:
- 2.0.48
-
NonErrorOnNumberOverflow
public static final JSONReader.Feature NonErrorOnNumberOverflow
- Since:
- 2.0.48
-
UseBigIntegerForInts
public static final JSONReader.Feature UseBigIntegerForInts
Feature that determines whether JSON integral (non-floating-point) numbers are to be deserialized intoBigIntegers if only generic type description (eitherObjectorNumber, or within untypedMaporCollectioncontext) is available. If enabled such values will be deserialized asBigIntegers; if disabled, will be deserialized as "smallest" available type, which is eitherInteger,LongorBigInteger, depending on number of digits.Feature is disabled by default, meaning that "untyped" integral numbers will by default be deserialized using whatever is the most compact integral type, to optimize efficiency.
- Since:
- 2.0.51
-
UseLongForInts
public static final JSONReader.Feature UseLongForInts
Feature that determines how "small" JSON integral (non-floating-point) numbers -- ones that fit in 32-bit signed integer (`int`) -- are bound when target type is loosely typed asObjectorNumber(or within untypedMaporCollectioncontext). If enabled, such values will be deserialized asLong; if disabled, they will be deserialized as "smallest" available type,Integer.Note: if
UseBigIntegerForIntsis enabled, it has precedence over this setting, forcing use ofBigIntegerfor all integral values.Feature is disabled by default, meaning that "untyped" integral numbers will by default be deserialized using
Integerif value fits.- Since:
- 2.0.51
-
-
Method Detail
-
values
public static JSONReader.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 (JSONReader.Feature c : JSONReader.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 JSONReader.Feature valueOf(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
of
public static long of(JSONReader.Feature[] features)
-
isEnabled
public boolean isEnabled(long features)
-
isEnabled
public static boolean isEnabled(long features, JSONReader.Feature feature)
-
-