|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.gwt.resource.Variant
org.restlet.gwt.resource.Representation
org.restlet.gwt.resource.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.gwt.resource.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. |
Method Summary | |
---|---|
java.lang.String |
getText()
Converts the representation to a string value. |
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.gwt.resource.Representation |
---|
createEmpty, getDownloadName, getExpirationDate, getModificationDate, getSize, getTag, isAvailable, isDownloadable, isTransient, setAvailable, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setSize, setTag, setTransient |
Methods inherited from class org.restlet.gwt.resource.Variant |
---|
getCharacterSet, getEncodings, getIdentifier, getLanguages, getMediaType, setCharacterSet, 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(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.Method Detail |
---|
public java.lang.String getText()
Representation
getText
in class Representation
public JSONValue getValue()
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 |