Class JsonToText
java.lang.Object
org.apache.sling.servlets.get.impl.util.JsonToText
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionoptions()
Return an Options object with default valuesprettyPrint
(jakarta.json.JsonArray ja, JsonToText.Options opt) Pretty-print a JSONArrayprettyPrint
(jakarta.json.JsonObject jo, JsonToText.Options opt) Make a prettyprinted JSON text of this JSONObject.
-
Constructor Details
-
JsonToText
public JsonToText()
-
-
Method Details
-
options
Return an Options object with default values -
prettyPrint
Make a prettyprinted JSON text of this JSONObject.Warning: This method assumes that the data structure is acyclical.
- Returns:
- a printable, displayable, transmittable
representation of the object, beginning
with
{
(left brace) and ending with}
(right brace). - Throws:
IllegalArgumentException
- If the object contains an invalid number.
-
prettyPrint
Pretty-print a JSONArray
-