|
||||||||||
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(java.lang.String jsonString)
Constructor from a JSON string. |
Method Summary | |
---|---|
JSONObject |
getJsonObject()
Converts the representation to a JSON object. |
java.io.Reader |
getReader()
|
long |
getSize()
|
java.io.InputStream |
getStream()
|
java.lang.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 |
---|
createEmpty, exhaust, getAvailableSize, getDisposition, getDownloadName, getExpirationDate, getRange, isAvailable, isDownloadable, isTransient, setAvailable, setDisposition, setDownloadable, setDownloadName, 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, getIdentifier, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setIdentifier, setIdentifier, 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(java.lang.String jsonString)
jsonString
- The JSON string.Method Detail |
---|
public JSONObject getJsonObject() throws java.io.IOException
java.io.IOException
public java.io.Reader getReader() throws java.io.IOException
getReader
in class Representation
java.io.IOException
public long getSize()
getSize
in class Representation
public java.io.InputStream getStream() throws java.io.IOException
getStream
in class Representation
java.io.IOException
public java.lang.String getText() throws java.io.IOException
getText
in class Representation
java.io.IOException
public JSONValue getValue() throws java.io.IOException
java.io.IOException
public void release()
release
in class Representation
public void setValue(JSONValue json)
json
- The wrapped JSON value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |