Package org.apache.sling.servlets.get.impl.util

# Class JsonToText

java.lang.Object
org.apache.sling.servlets.get.impl.util.JsonToText

public class JsonToText extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`JsonToText.Options`
Rendering options

## Constructor Summary

Constructors
Constructor
Description
`JsonToText()`

## Method Summary

Modifier and Type
Method
Description
`JsonToText.Options`
`options()`
Return an Options object with default values
`String`
`prettyPrint(jakarta.json.JsonArray ja, JsonToText.Options opt)`
Pretty-print a JSONArray
`String`
`prettyPrint(jakarta.json.JsonObject jo, JsonToText.Options opt)`
Make a prettyprinted JSON text of this JSONObject.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### JsonToText

public JsonToText()

## Method Details

### options

public JsonToText.Options options()
Return an Options object with default values

### prettyPrint

public String prettyPrint(jakarta.json.JsonObject jo, JsonToText.Options opt)
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

public String prettyPrint(jakarta.json.JsonArray ja, JsonToText.Options opt)
Pretty-print a JSONArray