public class JsonRepresentation extends Representation
UNKNOWN_SIZE
Constructor and Description |
---|
JsonRepresentation(MediaType mediaType)
Constructor for an empty document.
|
JsonRepresentation(MediaType mediaType,
com.google.gwt.json.client.JSONValue value)
Constructor from an existing DOM document.
|
JsonRepresentation(Representation jsonRepresentation)
Constructor.
|
JsonRepresentation(java.lang.String jsonString)
Constructor from a JSON string.
|
Modifier and Type | Method and Description |
---|---|
com.google.gwt.json.client.JSONArray |
getJsonArray()
Converts the representation to a JSON array.
|
com.google.gwt.json.client.JSONBoolean |
getJsonBoolean()
Converts the representation to a JSON Boolean.
|
com.google.gwt.json.client.JSONNull |
getJsonNull()
Converts the representation to a JSON null value.
|
com.google.gwt.json.client.JSONObject |
getJsonObject()
Converts the representation to a JSON object.
|
com.google.gwt.json.client.JSONString |
getJsonString()
Converts the representation to a JSON string.
|
java.io.Reader |
getReader() |
long |
getSize() |
java.io.InputStream |
getStream() |
java.lang.String |
getText() |
com.google.gwt.json.client.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(com.google.gwt.json.client.JSONValue json)
Sets the wrapped JSON value.
|
append, exhaust, getAvailableSize, getDisposition, getExpirationDate, getRange, hasKnownSize, isAvailable, isEmpty, isTransient, setAvailable, setDisposition, setExpirationDate, setRange, setSize, setTransient
getModificationDate, getTag, setModificationDate, setTag
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
public JsonRepresentation(MediaType mediaType)
mediaType
- The representation's media type.public JsonRepresentation(MediaType mediaType, com.google.gwt.json.client.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.public com.google.gwt.json.client.JSONArray getJsonArray() throws java.io.IOException
java.io.IOException
public com.google.gwt.json.client.JSONBoolean getJsonBoolean() throws java.io.IOException
java.io.IOException
public com.google.gwt.json.client.JSONNull getJsonNull() throws java.io.IOException
java.io.IOException
public com.google.gwt.json.client.JSONObject getJsonObject() throws java.io.IOException
java.io.IOException
public com.google.gwt.json.client.JSONString getJsonString() 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 com.google.gwt.json.client.JSONValue getValue() throws java.io.IOException
java.io.IOException
public void release()
release
in class Representation
public void setValue(com.google.gwt.json.client.JSONValue json)
json
- The wrapped JSON value.Copyright © 2005-2024 Restlet.