Package com.alibaba.fastjson2
Enum JSONWriter.Feature
- All Implemented Interfaces:
Serializable
,Comparable<JSONWriter.Feature>
,java.lang.constant.Constable
- Enclosing class:
- JSONWriter
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated.use IgnoreEmptyJSON formatting support using 4 spaces for indentationJSON formatting support using 4 spaces for indentationThe serialized Map will first be sorted according to Key, and is used in some scenarios where serialized content needs to be signed. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
isEnabled
(long features) static JSONWriter.Feature
Returns the enum constant of this type with the specified name.static JSONWriter.Feature[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
FieldBased
-
IgnoreNoneSerializable
-
ErrorOnNoneSerializable
-
BeanToArray
-
WriteNulls
-
WriteMapNullValue
-
BrowserCompatible
-
NullAsDefaultValue
-
WriteBooleanAsNumber
-
WriteNonStringValueAsString
-
WriteClassName
-
NotWriteRootClassName
-
NotWriteHashMapArrayListClassName
-
NotWriteDefaultValue
-
WriteEnumsUsingName
-
WriteEnumUsingToString
-
IgnoreErrorGetter
-
PrettyFormat
-
ReferenceDetection
-
WriteNameAsSymbol
-
WriteBigDecimalAsPlain
-
UseSingleQuotes
-
MapSortField
-
WriteNullListAsEmpty
-
WriteNullStringAsEmpty
- Since:
- 1.1
-
WriteNullNumberAsZero
- Since:
- 1.1
-
WriteNullBooleanAsFalse
- Since:
- 1.1
-
NotWriteEmptyArray
Deprecated.use IgnoreEmpty- Since:
- 2.0.7
-
IgnoreEmpty
- Since:
- 2.0.51
-
WriteNonStringKeyAsString
-
WritePairAsJavaBean
- Since:
- 2.0.11
-
OptimizedForAscii
- Since:
- 2.0.12
-
EscapeNoneAscii
- Since:
- 2.0.12 Feature that specifies that all characters beyond 7-bit ASCII range (i.e. code points of 128 and above) need to be output using format-specific escapes (for JSON, backslash escapes), if format uses escaping mechanisms (which is generally true for textual formats but not for binary formats). Feature is disabled by default.
-
WriteByteArrayAsBase64
- Since:
- 2.0.13
-
IgnoreNonFieldGetter
- Since:
- 2.0.13
-
LargeObject
- Since:
- 2.0.16
-
WriteLongAsString
- Since:
- 2.0.17
-
BrowserSecure
- Since:
- 2.0.20
-
WriteEnumUsingOrdinal
-
WriteThrowableClassName
- Since:
- 2.0.30
-
UnquoteFieldName
- Since:
- 2.0.33
-
NotWriteSetClassName
- Since:
- 2.0.34
-
NotWriteNumberClassName
- Since:
- 2.0.34
-
SortMapEntriesByKeys
The serialized Map will first be sorted according to Key, and is used in some scenarios where serialized content needs to be signed. SortedMap and derived classes do not need to do this.- Since:
- 2.0.48
-
PrettyFormatWith2Space
JSON formatting support using 4 spaces for indentation- Since:
- 2.0.54
-
PrettyFormatWith4Space
JSON formatting support using 4 spaces for indentation- Since:
- 2.0.54
-
-
Field Details
-
mask
public final long mask
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
isEnabled
public boolean isEnabled(long features)
-