|
Restlet Framework 2.2.1 Google Web Toolkit |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.client.representation.Variant
org.restlet.client.representation.RepresentationInfo
org.restlet.client.representation.Representation
org.restlet.client.ext.json.JsonRepresentation
public class JsonRepresentation
JSON representation based on an JSON value. JSON (JavaScript Object Notation) is a common serialization format similar to XML but lighter.
Field Summary |
---|
Fields inherited from class org.restlet.client.representation.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
JsonRepresentation(MediaType mediaType)
Constructor for an empty document. |
|
JsonRepresentation(MediaType mediaType,
JSONValue value)
Constructor from an existing DOM document. |
|
JsonRepresentation(Representation jsonRepresentation)
Constructor. |
|
JsonRepresentation(String jsonString)
Constructor from a JSON string. |
Method Summary | |
---|---|
JSONArray |
getJsonArray()
Converts the representation to a JSON array. |
JSONBoolean |
getJsonBoolean()
Converts the representation to a JSON Boolean. |
JSONNull |
getJsonNull()
Converts the representation to a JSON null value. |
JSONObject |
getJsonObject()
Converts the representation to a JSON object. |
JSONString |
getJsonString()
Converts the representation to a JSON string. |
Reader |
getReader()
|
long |
getSize()
|
InputStream |
getStream()
|
String |
getText()
|
JSONValue |
getValue()
Returns the wrapped JSON value. |
void |
release()
Releases the wrapped JSON value and the source JSON representation if they have been defined. |
void |
setValue(JSONValue json)
Sets the wrapped JSON value. |
Methods inherited from class org.restlet.client.representation.Representation |
---|
append, exhaust, getAvailableSize, getDisposition, getExpirationDate, getRange, hasKnownSize, isAvailable, isEmpty, isTransient, setAvailable, setDisposition, setExpirationDate, setRange, setSize, setTransient |
Methods inherited from class org.restlet.client.representation.RepresentationInfo |
---|
getModificationDate, getTag, setModificationDate, setTag |
Methods inherited from class org.restlet.client.representation.Variant |
---|
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JsonRepresentation(MediaType mediaType)
mediaType
- The representation's media type.public JsonRepresentation(MediaType mediaType, JSONValue value)
mediaType
- The representation's media type.value
- The source JSON value.public JsonRepresentation(Representation jsonRepresentation)
jsonRepresentation
- A source JSON representation to parse.public JsonRepresentation(String jsonString)
jsonString
- The JSON string.Method Detail |
---|
public JSONArray getJsonArray() throws IOException
IOException
public JSONBoolean getJsonBoolean() throws IOException
IOException
public JSONNull getJsonNull() throws IOException
IOException
public JSONObject getJsonObject() throws IOException
IOException
public JSONString getJsonString() throws IOException
IOException
public Reader getReader() throws IOException
getReader
in class Representation
IOException
public long getSize()
getSize
in class Representation
public InputStream getStream() throws IOException
getStream
in class Representation
IOException
public String getText() throws IOException
getText
in class Representation
IOException
public JSONValue getValue() throws IOException
IOException
public void release()
release
in class Representation
public void setValue(JSONValue json)
json
- The wrapped JSON value.
|
Restlet Framework 2.2.1 Google Web Toolkit |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |