public final class JsonConstructorUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
JSON_ABSENT_ON_NULL
The ABSENT ON NULL flag.
|
static int |
JSON_WITH_UNIQUE_KEYS
The WITH UNIQUE KEYS flag.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
jsonArrayAppend(ByteArrayOutputStream baos,
Value value,
int flags)
Appends a value to a JSON array in the specified output stream.
|
static void |
jsonObjectAppend(ByteArrayOutputStream baos,
String key,
Value value)
Appends a value to a JSON object in the specified string builder.
|
static Value |
jsonObjectFinish(ByteArrayOutputStream baos,
int flags)
Appends trailing closing brace to the specified string builder with a
JSON object, validates it, and converts to a JSON value.
|
public static final int JSON_ABSENT_ON_NULL
public static final int JSON_WITH_UNIQUE_KEYS
public static void jsonObjectAppend(ByteArrayOutputStream baos, String key, Value value)
baos - the output stream to append tokey - the name of the propertyvalue - the value of the propertypublic static Value jsonObjectFinish(ByteArrayOutputStream baos, int flags)
baos - the output stream with the objectflags - the flags (JSON_WITH_UNIQUE_KEYS)DbException - if JSON_WITH_UNIQUE_KEYS is specified and keys are
not uniquepublic static void jsonArrayAppend(ByteArrayOutputStream baos, Value value, int flags)
baos - the output stream to append tovalue - the valueflags - the flags (JSON_ABSENT_ON_NULL)Copyright © 2022. All rights reserved.