Package com.adobe.aem.dermis.model
Class JSONRenderer
- java.lang.Object
-
- org.apache.sling.commons.json.io.JSONRenderer
-
- com.adobe.aem.dermis.model.JSONRenderer
-
public class JSONRenderer extends org.apache.sling.commons.json.io.JSONRenderer
Extending Sling JSONObject to override the behaviour of toString.
-
-
Constructor Summary
Constructors Constructor Description JSONRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
valueToString(java.lang.Object value)
Make a JSON text of an Object value.
-
-
-
Method Detail
-
valueToString
public java.lang.String valueToString(java.lang.Object value) throws org.apache.sling.commons.json.JSONException
Make a JSON text of an Object value. If the object has an value.toJSONString() method, then that method will be used to produce the JSON text. The method is required to produce a strictly conforming text. If the object does not contain a toJSONString method (which is the most common case), then a text will be produced by the rules.Warning: This method assumes that the data structure is acyclical.
- Overrides:
valueToString
in classorg.apache.sling.commons.json.io.JSONRenderer
- Parameters:
value
- The value to be serialized.- Returns:
- a printable, displayable, transmittable
representation of the object, beginning
with
{
(left brace) and ending with}
(right brace). - Throws:
org.apache.sling.commons.json.JSONException
- If the value is or contains an invalid number.
-
-