public class JsonOutput extends Object
Class responsible for the actual String serialization of the possible values of a JSON structure.
This class can also be used as a category to add toJson() methods to various types.
This class does not provide the ability to customize the resulting output. A JsonGenerator can be used if the ability to alter the resulting output is required.
| Modifiers | Name | Description |
|---|---|---|
static class |
JsonOutput.JsonUnescaped |
Represents unescaped JSON |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static String |
String jsonPayload)Pretty print a JSON payload. |
|
public static String |
String jsonPayload, boolean disableUnicodeEscaping)Pretty print a JSON payload. |
|
public static String |
Boolean bool)
|
|
public static String |
Number n)
|
|
public static String |
Character c)
|
|
public static String |
String s)
|
|
public static String |
Date date)Format a date that is parseable from JavaScript, according to ISO-8601. |
|
public static String |
Calendar cal)Format a calendar instance that is parseable from JavaScript, according to ISO-8601. |
|
public static String |
UUID uuid)
|
|
public static String |
URL url)
|
|
public static String |
Closure closure)
|
|
public static String |
Expando expando)
|
|
public static String |
Object object)
|
|
public static String |
Map m)
|
|
public static JsonOutput.JsonUnescaped |
CharSequence text)Obtains JSON unescaped text for the given text |
Pretty print a JSON payload.
jsonPayload - a JSON payloadPretty print a JSON payload.
jsonPayload - a JSON payloaddisableUnicodeEscaping - whether to disable unicode escapingFormat a date that is parseable from JavaScript, according to ISO-8601.
date - the date to format to a JSON stringFormat a calendar instance that is parseable from JavaScript, according to ISO-8601.
cal - the calendar to format to a JSON string
Obtains JSON unescaped text for the given text
text - The text