|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.taglib.json.JsonEntity
public class JsonEntity
Wrapper object for JSON Entities. A JSON Entity can be either a JSONObject or JSONArray. One of these object types will always be sitting on the top of the object stack, so this class provides a wrapper that can be used to either add a property to an object or append a property to an array.
Constructor Summary | |
---|---|
JsonEntity(java.lang.Object pWrapped)
Create a new JsonEntity object |
Method Summary | |
---|---|
void |
add(java.lang.Object pEntity,
java.lang.String pName)
Add a named entity to a JSONObject or append an entity to a JSONArray depending on whether the wrapped object is an object or array. |
java.lang.Object |
getWrappedObject()
Get the underlying wrapped JSONObject or JSONArray object |
boolean |
isArray()
Is this entity wrapping a JSONArray? |
boolean |
isObject()
Is this entity wrapping a JSONObject? |
java.lang.String |
toString()
Serialize the underlying wrapped entity to a JSON string |
java.lang.String |
toString(int pIndentFactor)
Serialize the underlying wrapped entity to a JSON string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JsonEntity(java.lang.Object pWrapped)
pWrapped
- The underlying object to wrapMethod Detail |
---|
public void add(java.lang.Object pEntity, java.lang.String pName) throws JSONException
pEntity
- The entity to add to the wrapped objectpName
- The property name of the entity, or null
if not available
JSONException
public java.lang.Object getWrappedObject()
public boolean isArray()
true
if this entity wraps a JSONArray, false
otherwisepublic boolean isObject()
true
if this entity wraps a JSONObject, false
otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toString(int pIndentFactor) throws JSONException
pIndentFactor
- The number of spaces to use to pretty-print the data
JSONException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |