Class JsonToText

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

public class JsonToText extends Object
  • 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