public final class JsonConstructorUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
JSON_ABSENT_ON_NULL
The ABSENT ON NULL flag.
|
static int |
JSON_WITH_UNIQUE_KEYS
The WITH UNIQUE KEYS flag.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
jsonArrayAppend(java.io.ByteArrayOutputStream baos,
Value value,
int flags)
Appends a value to a JSON array in the specified output stream.
|
static void |
jsonObjectAppend(java.io.ByteArrayOutputStream baos,
java.lang.String key,
Value value)
Appends a value to a JSON object in the specified string builder.
|
static Value |
jsonObjectFinish(java.io.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(java.io.ByteArrayOutputStream baos,
java.lang.String key,
Value value)
baos - the output stream to append tokey - the name of the propertyvalue - the value of the propertypublic static Value jsonObjectFinish(java.io.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(java.io.ByteArrayOutputStream baos,
Value value,
int flags)
baos - the output stream to append tovalue - the valueflags - the flags (JSON_ABSENT_ON_NULL)