|
||||||||||
| 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.Representation |
|---|
UNKNOWN_SIZE |
| Constructor Summary | |
|---|---|
JsonRepresentation(JSONObject jsonObject)
Constructor from a JSON object. |
|
JsonRepresentation(Map<Object,Object> map)
Constructor from a map object. |
|
JsonRepresentation(Object bean)
Constructor from a bean using reflection to generate JSON names. |
|
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, release, setCharacterSet, setText, updateSize, write |
| Methods inherited from class org.restlet.resource.StreamRepresentation |
|---|
getChannel, getReader, write, write |
| Methods inherited from class org.restlet.resource.Representation |
|---|
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDownloadName, getExpirationDate, getModificationDate, getRange, getSize, getTag, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setRange, setSize, setTag, setTransient |
| Methods inherited from class org.restlet.resource.Variant |
|---|
getCharacterSet, getEncodings, getIdentifier, getLanguages, getMediaType, setEncodings, setIdentifier, setIdentifier, setLanguages, setMediaType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonRepresentation(JSONObject jsonObject)
jsonObject - The JSON object.public JsonRepresentation(Map<Object,Object> map)
map - The map to convert to JSON.JSONObject.JSONObject(Map)public JsonRepresentation(Object bean)
bean - The bean to convert to JSON.JSONObject.JSONObject(Object)
public JsonRepresentation(Representation jsonRepresentation)
throws IOException
jsonRepresentation - A source JSON representation to parse.
IOExceptionpublic JsonRepresentation(String jsonString)
jsonString - The JSON string.| Method Detail |
|---|
public JSONArray toJsonArray()
throws JSONException
JSONException
public JSONObject toJsonObject()
throws JSONException
JSONException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||