Package com.alibaba.fastjson2
Enum JSONWriter.Feature
- java.lang.Object
-
- java.lang.Enum<JSONWriter.Feature>
-
- com.alibaba.fastjson2.JSONWriter.Feature
-
- All Implemented Interfaces:
Serializable,Comparable<JSONWriter.Feature>
- Enclosing class:
- JSONWriter
public static enum JSONWriter.Feature extends Enum<JSONWriter.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 JSONWriter.FeaturevalueOf(String name)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 Detail
-
FieldBased
public static final JSONWriter.Feature FieldBased
-
IgnoreNoneSerializable
public static final JSONWriter.Feature IgnoreNoneSerializable
-
ErrorOnNoneSerializable
public static final JSONWriter.Feature ErrorOnNoneSerializable
-
BeanToArray
public static final JSONWriter.Feature BeanToArray
-
WriteNulls
public static final JSONWriter.Feature WriteNulls
-
WriteMapNullValue
public static final JSONWriter.Feature WriteMapNullValue
-
BrowserCompatible
public static final JSONWriter.Feature BrowserCompatible
-
NullAsDefaultValue
public static final JSONWriter.Feature NullAsDefaultValue
-
WriteBooleanAsNumber
public static final JSONWriter.Feature WriteBooleanAsNumber
-
WriteNonStringValueAsString
public static final JSONWriter.Feature WriteNonStringValueAsString
-
WriteClassName
public static final JSONWriter.Feature WriteClassName
-
NotWriteRootClassName
public static final JSONWriter.Feature NotWriteRootClassName
-
NotWriteHashMapArrayListClassName
public static final JSONWriter.Feature NotWriteHashMapArrayListClassName
-
NotWriteDefaultValue
public static final JSONWriter.Feature NotWriteDefaultValue
-
WriteEnumsUsingName
public static final JSONWriter.Feature WriteEnumsUsingName
-
WriteEnumUsingToString
public static final JSONWriter.Feature WriteEnumUsingToString
-
IgnoreErrorGetter
public static final JSONWriter.Feature IgnoreErrorGetter
-
PrettyFormat
public static final JSONWriter.Feature PrettyFormat
-
ReferenceDetection
public static final JSONWriter.Feature ReferenceDetection
-
WriteNameAsSymbol
public static final JSONWriter.Feature WriteNameAsSymbol
-
WriteBigDecimalAsPlain
public static final JSONWriter.Feature WriteBigDecimalAsPlain
-
UseSingleQuotes
public static final JSONWriter.Feature UseSingleQuotes
-
MapSortField
public static final JSONWriter.Feature MapSortField
Deprecated.UseSortMapEntriesByKeysinstead.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. This Feature does not work for LinkedHashMap.
-
WriteNullListAsEmpty
public static final JSONWriter.Feature WriteNullListAsEmpty
-
WriteNullStringAsEmpty
public static final JSONWriter.Feature WriteNullStringAsEmpty
- Since:
- 1.1
-
WriteNullNumberAsZero
public static final JSONWriter.Feature WriteNullNumberAsZero
- Since:
- 1.1
-
WriteNullBooleanAsFalse
public static final JSONWriter.Feature WriteNullBooleanAsFalse
- Since:
- 1.1
-
NotWriteEmptyArray
public static final JSONWriter.Feature NotWriteEmptyArray
Deprecated.use IgnoreEmpty- Since:
- 2.0.7
-
IgnoreEmpty
public static final JSONWriter.Feature IgnoreEmpty
- Since:
- 2.0.51
-
WriteNonStringKeyAsString
public static final JSONWriter.Feature WriteNonStringKeyAsString
-
WritePairAsJavaBean
public static final JSONWriter.Feature WritePairAsJavaBean
- Since:
- 2.0.11
-
OptimizedForAscii
public static final JSONWriter.Feature OptimizedForAscii
- Since:
- 2.0.12
-
EscapeNoneAscii
public static final JSONWriter.Feature 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
public static final JSONWriter.Feature WriteByteArrayAsBase64
- Since:
- 2.0.13
-
IgnoreNonFieldGetter
public static final JSONWriter.Feature IgnoreNonFieldGetter
- Since:
- 2.0.13
-
LargeObject
public static final JSONWriter.Feature LargeObject
- Since:
- 2.0.16
-
WriteLongAsString
public static final JSONWriter.Feature WriteLongAsString
- Since:
- 2.0.17
-
BrowserSecure
public static final JSONWriter.Feature BrowserSecure
- Since:
- 2.0.20
-
WriteEnumUsingOrdinal
public static final JSONWriter.Feature WriteEnumUsingOrdinal
-
WriteThrowableClassName
public static final JSONWriter.Feature WriteThrowableClassName
- Since:
- 2.0.30
-
UnquoteFieldName
public static final JSONWriter.Feature UnquoteFieldName
- Since:
- 2.0.33
-
NotWriteSetClassName
public static final JSONWriter.Feature NotWriteSetClassName
- Since:
- 2.0.34
-
NotWriteNumberClassName
public static final JSONWriter.Feature NotWriteNumberClassName
- Since:
- 2.0.34
-
SortMapEntriesByKeys
public static final JSONWriter.Feature 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
-
-
Method Detail
-
values
public static JSONWriter.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 (JSONWriter.Feature c : JSONWriter.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 JSONWriter.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
-
isEnabled
public boolean isEnabled(long features)
-
-