|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
org.restlet.resource.StringRepresentation
org.restlet.ext.json.JsonRepresentation
public class JsonRepresentation
Representation based on a JSON document. JSON stands for JavaScript Object Notation and is a lightweight data-interchange format.
Field Summary |
---|
Fields inherited from class org.restlet.resource.Variant |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
JsonRepresentation(JSONArray jsonArray)
Constructor from a JSON array. |
|
JsonRepresentation(JSONObject jsonObject)
Constructor from a JSON object. |
|
JsonRepresentation(Representation jsonRepresentation)
Constructor. |
|
JsonRepresentation(String jsonString)
Constructor from a JSON string. |
Method Summary | |
---|---|
JSONArray |
toJsonArray()
Converts the representation to a JSON array. |
JSONObject |
toJsonObject()
Converts the representation to a JSON object. |
Methods inherited from class org.restlet.resource.StringRepresentation |
---|
getStream, getText, setCharacterSet, setText, updateSize, write |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, write |
Methods inherited from class org.restlet.resource.Representation |
---|
isAvailable, isTransient, setAvailable, setTransient |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getSize, getTag, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JsonRepresentation(Representation jsonRepresentation) throws IOException
jsonRepresentation
- A source JSON representation to parse.
IOException
public JsonRepresentation(JSONObject jsonObject)
jsonObject
- The JSON object.public JsonRepresentation(JSONArray jsonArray)
jsonArray
- The JSON array.public JsonRepresentation(String jsonString)
jsonString
- The JSON string.Method Detail |
---|
public JSONObject toJsonObject() throws JSONException
JSONException
public JSONArray toJsonArray() throws JSONException
JSONException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |