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, setTransientgetModificationDate, getTag, setModificationDate, setTagcreateClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toStringpublic 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.IOExceptionpublic com.google.gwt.json.client.JSONBoolean getJsonBoolean()
throws java.io.IOException
java.io.IOExceptionpublic com.google.gwt.json.client.JSONNull getJsonNull()
throws java.io.IOException
java.io.IOExceptionpublic com.google.gwt.json.client.JSONObject getJsonObject()
throws java.io.IOException
java.io.IOExceptionpublic com.google.gwt.json.client.JSONString getJsonString()
throws java.io.IOException
java.io.IOExceptionpublic java.io.Reader getReader()
throws java.io.IOException
getReader in class Representationjava.io.IOExceptionpublic long getSize()
getSize in class Representationpublic java.io.InputStream getStream()
throws java.io.IOException
getStream in class Representationjava.io.IOExceptionpublic java.lang.String getText()
throws java.io.IOException
getText in class Representationjava.io.IOExceptionpublic com.google.gwt.json.client.JSONValue getValue()
throws java.io.IOException
java.io.IOExceptionpublic void release()
release in class Representationpublic void setValue(com.google.gwt.json.client.JSONValue json)
json - The wrapped JSON value.Copyright © 2005-2024 Restlet.