Class JsonOutput
java.lang.Object
groovy.json.JsonOutput
Class responsible for the actual String serialization of the possible values of a JSON structure.
This class can also be used as a category, so as to add
toJson() methods to various types.- Since:
- 1.8.0
- Author:
- Guillaume Laforge, Roshan Dawrani, Andrey Bloschetsov, Rick Hightower, Graeme Rocher
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringprettyPrint(String jsonPayload) Pretty print a JSON payload.static Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic StringFormat a calendar instance that is parseable from JavaScript, according to ISO-8601.static StringFormat a date that is parseable from JavaScript, according to ISO-8601.static Stringstatic Stringstatic JsonOutput.JsonUnescapedunescaped(CharSequence text) Obtains JSON unescaped text for the given text
-
Constructor Details
-
JsonOutput
public JsonOutput()
-
-
Method Details
-
toJson
-
toJson
- Returns:
- a string representation for a number
- Throws:
JsonException- if the number is infinite or not a number.
-
toJson
-
toJson
-
toJson
-
toJson
-
toJson
-
toJson
-
toJson
-
toJson
-
toJson
-
toJson
-
prettyPrint
-
unescaped
Obtains JSON unescaped text for the given text- Parameters:
text- The text- Returns:
- The unescaped text
-