| Package | Description |
|---|---|
| com.alibaba.fastjson2 | |
| com.alibaba.fastjson2.support.config | |
| com.alibaba.fastjson2.util | |
| com.alibaba.fastjson2.writer |
| Modifier and Type | Method and Description |
|---|---|
static JSONWriter.Feature |
JSONWriter.Feature.valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static JSONWriter.Feature[] |
JSONWriter.Feature.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
JSON.config(JSONWriter.Feature... features)
Enable the specified features in default writer
|
void |
JSONWriter.config(JSONWriter.Feature... features)
Configures features for this JSONWriter.
|
void |
JSONWriter.Context.config(JSONWriter.Feature... features)
Configures features for this context.
|
static void |
JSON.config(JSONWriter.Feature feature,
boolean state)
Enable or disable the specified features in default writer
|
void |
JSONWriter.config(JSONWriter.Feature feature,
boolean state)
Configures a specific feature for this JSONWriter.
|
void |
JSONWriter.Context.config(JSONWriter.Feature feature,
boolean state)
Configures a specific feature for this context.
|
static <T> T |
JSON.copy(T object,
JSONWriter.Feature... features)
Builds a new
T using the properties of the specified object |
static <T> T |
JSONB.copy(T object,
JSONWriter.Feature... features)
Creates a deep copy of the specified object
|
static <T> T |
JSON.copyTo(java.lang.Object object,
java.lang.Class<T> targetClass,
JSONWriter.Feature... features)
Builds a new instance of targetClass using the properties of the specified object
|
static JSONWriter.Context |
JSONFactory.createWriteContext(JSONWriter.Feature... features)
Creates a new JSON writer context with the specified features.
|
static JSONWriter.Context |
JSONFactory.createWriteContext(ObjectWriterProvider provider,
JSONWriter.Feature... features)
Creates a new JSON writer context with the specified provider and features.
|
static JSONArray |
JSONArray.from(java.lang.Object obj,
JSONWriter.Feature... writeFeatures)
See
JSON.toJSON(java.lang.Object) for details |
static JSONObject |
JSONObject.from(java.lang.Object obj,
JSONWriter.Feature... writeFeatures)
See
JSON.toJSON(java.lang.Object) for details |
static boolean |
JSON.isEnabled(JSONWriter.Feature feature)
Check if the default writer enables the specified feature
|
boolean |
JSONWriter.isEnabled(JSONWriter.Feature feature)
Checks if the specified feature is enabled.
|
boolean |
JSONWriter.Context.isEnabled(JSONWriter.Feature feature)
Checks if the specified feature is enabled in this context.
|
static JSONWriter |
JSONWriter.of(JSONWriter.Feature... features)
Creates a new JSONWriter with the specified features.
|
static JSONWriter |
JSONWriter.of(ObjectWriterProvider provider,
JSONWriter.Feature... features)
Creates a new JSONWriter with the specified object writer provider and features.
|
static JSONWriter |
JSONWriter.ofJSONB(JSONWriter.Feature... features)
Creates a new JSONWriter instance for JSONB (binary JSON) format with the specified features.
|
static JSONWriter |
JSONWriter.ofUTF16(JSONWriter.Feature... features)
Creates a new JSONWriter instance using UTF-16 encoding with the specified features.
|
static JSONWriter |
JSONWriter.ofUTF8(JSONWriter.Feature... features)
Creates a new JSONWriter instance using UTF-8 encoding with the specified features.
|
static byte[] |
JSONB.toBytes(java.lang.Object object,
JSONWriter.Context context,
SymbolTable symbolTable,
JSONWriter.Feature... features)
Converts an object to JSONB bytes with specified context, symbol table and features
|
static byte[] |
JSONB.toBytes(java.lang.Object object,
JSONWriter.Feature... features)
Converts an object to JSONB bytes with specified features
|
static byte[] |
JSONB.toBytes(java.lang.Object object,
SymbolTable symbolTable,
Filter[] filters,
JSONWriter.Feature... features)
Converts an object to JSONB bytes with a symbol table, filters and features
|
static byte[] |
JSONB.toBytes(java.lang.Object object,
SymbolTable symbolTable,
JSONWriter.Feature... features)
Converts an object to JSONB bytes with a symbol table and features
|
static java.lang.Object |
JSON.toJSON(java.lang.Object object,
JSONWriter.Feature... features)
Converts the specified object to a
JSONArray or
JSONObject. |
byte[] |
JSONArray.toJSONBBytes(JSONWriter.Feature... features)
Serialize to JSONB bytes
|
byte[] |
JSONObject.toJSONBBytes(JSONWriter.Feature... features)
Serialize to JSONB bytes
|
static byte[] |
JSON.toJSONBytes(java.lang.Object object,
java.nio.charset.Charset charset,
JSONWriter.Feature... features)
Serializes the specified object to the json byte array
|
static byte[] |
JSON.toJSONBytes(java.lang.Object object,
Filter[] filters,
JSONWriter.Feature... features)
Serializes the specified object to the json byte array
|
static byte[] |
JSON.toJSONBytes(java.lang.Object object,
JSONWriter.Feature... features)
Serializes the specified object to the json byte array
|
static byte[] |
JSON.toJSONBytes(java.lang.Object object,
java.lang.String format,
Filter[] filters,
JSONWriter.Feature... features)
Serializes the specified object to the json byte array
|
static byte[] |
JSON.toJSONBytes(java.lang.Object object,
java.lang.String format,
JSONWriter.Feature... features)
Serializes the specified object to the json byte array
|
java.lang.String |
JSONArray.toJSONString(JSONWriter.Feature... features)
Serialize to JSON
String |
java.lang.String |
JSONObject.toJSONString(JSONWriter.Feature... features)
Serialize to JSON
String |
static java.lang.String |
JSON.toJSONString(java.lang.Object object,
Filter[] filters,
JSONWriter.Feature... features)
Serializes the specified object to the json string
|
static java.lang.String |
JSON.toJSONString(java.lang.Object object,
Filter filter,
JSONWriter.Feature... features)
Serializes the specified object to the json string
|
static java.lang.String |
JSON.toJSONString(java.lang.Object object,
JSONWriter.Feature... features)
Serializes the specified object to the json string
|
static java.lang.String |
JSONArray.toJSONString(java.lang.Object object,
JSONWriter.Feature... features)
Serialize Java Object to JSON
String with specified JSONReader.Features enabled |
static java.lang.String |
JSONObject.toJSONString(java.lang.Object object,
JSONWriter.Feature... features)
Serialize Java Object to JSON
String with specified JSONReader.Features enabled |
static java.lang.String |
JSON.toJSONString(java.lang.Object object,
java.lang.String format,
Filter[] filters,
JSONWriter.Feature... features)
Serializes the specified object to the json string
|
static java.lang.String |
JSON.toJSONString(java.lang.Object object,
java.lang.String format,
JSONWriter.Feature... features)
Serializes the specified object to the json string
|
java.lang.String |
JSONArray.toString(JSONWriter.Feature... features)
Serialize to JSON
String |
java.lang.String |
JSONObject.toString(JSONWriter.Feature... features)
Serialize to JSON
String |
static int |
JSON.writeTo(java.io.OutputStream out,
java.lang.Object object,
Filter[] filters,
JSONWriter.Feature... features)
Serializes the specified object to the json byte array and write it to
OutputStream |
static int |
JSON.writeTo(java.io.OutputStream out,
java.lang.Object object,
JSONWriter.Feature... features)
Serializes the specified object to the json byte array and write it to
OutputStream |
static int |
JSONB.writeTo(java.io.OutputStream out,
java.lang.Object object,
JSONWriter.Feature... features)
Writes an object to an output stream as JSONB bytes
|
static int |
JSON.writeTo(java.io.OutputStream out,
java.lang.Object object,
java.lang.String format,
Filter[] filters,
JSONWriter.Feature... features)
Serializes the specified object to the json byte array and write it to
OutputStream |
| Constructor and Description |
|---|
Context(JSONWriter.Feature... features)
Creates a new Context with the specified features.
|
Context(ObjectWriterProvider provider,
JSONWriter.Feature... features)
Creates a new Context with the specified object writer provider and features.
|
Context(java.lang.String format,
JSONWriter.Feature... features)
Creates a new Context with the specified date format and features.
|
| Modifier and Type | Field and Description |
|---|---|
private JSONWriter.Feature[] |
FastJsonConfig.writerFeatures
JSONWriter Features
|
| Modifier and Type | Method and Description |
|---|---|
JSONWriter.Feature[] |
FastJsonConfig.getWriterFeatures()
Get writer features json writer .
|
| Modifier and Type | Method and Description |
|---|---|
void |
FastJsonConfig.setWriterFeatures(JSONWriter.Feature... writerFeatures)
Sets writer features.
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.Properties |
PropertiesUtils.toProperties(ObjectWriterProvider provider,
java.lang.Object object,
JSONWriter.Feature... features) |
| Modifier and Type | Method and Description |
|---|---|
default java.lang.String |
ObjectWriter.toJSONString(T object,
JSONWriter.Feature... features)
Converts an object to its JSON string representation using the specified features.
|