public class JsonUtil extends Object
Constructor and Description |
---|
JsonUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
escapeControlChars(String text)
Convert special control characters into unicode escape format.
|
static <T extends JsonValue> |
parse(String json) |
static String |
quote(String value)
Safely escape an arbitrary string as a JSON string literal.
|
static String |
stringify(JsonValue jsonValue)
Converts a Json Object to Json format.
|
static String |
stringify(JsonValue jsonValue,
int spaces)
Converts a JSO to Json format.
|
static String |
stringify(JsonValue jsonValue,
String indent)
Converts a Json object to Json formatted String.
|
public static String escapeControlChars(String text)
public static <T extends JsonValue> T parse(String json) throws JsonException
JsonException
public static String quote(String value)
public static String stringify(JsonValue jsonValue)
jsonValue
- json object to stringifypublic static String stringify(JsonValue jsonValue, int spaces)
jsonValue
- json object to stringifyspaces
- number of spaces to indent in pretty print modeCopyright © 2016. All rights reserved.