|
Restlet Framework 2.2.3 Android |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.representation.Variant
org.restlet.representation.RepresentationInfo
org.restlet.representation.Representation
org.restlet.representation.CharacterRepresentation
org.restlet.representation.WriterRepresentation
org.restlet.ext.gson.GsonRepresentation<T>
public class GsonRepresentation<T>
Representation based on a JSON document. JSON stands for JavaScript Object Notation and is a lightweight data-interchange format.
Field Summary |
---|
Fields inherited from class org.restlet.representation.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
GsonRepresentation(Representation representation,
java.lang.Class<T> objectClass)
Constructor. |
|
GsonRepresentation(T object)
Constructor for the JSON media type. |
Method Summary | |
---|---|
protected com.google.gson.GsonBuilder |
createBuilder()
Returns a new instance of the builder for Gson instances. |
com.google.gson.GsonBuilder |
getBuilder()
Returns the builder for Gson instances. |
T |
getObject()
Returns the wrapped object, deserializing the representation with Gson if necessary. |
java.lang.Class<T> |
getObjectClass()
Returns the object class to instantiate. |
void |
setBuilder(com.google.gson.GsonBuilder builder)
Sets the Gson builder. |
void |
setObject(T object)
Sets the object to format. |
void |
setObjectClass(java.lang.Class<T> objectClass)
Sets the object class to instantiate. |
void |
write(java.io.Writer writer)
|
Methods inherited from class org.restlet.representation.WriterRepresentation |
---|
getReader |
Methods inherited from class org.restlet.representation.CharacterRepresentation |
---|
getChannel, getStream, write, write |
Methods inherited from class org.restlet.representation.Representation |
---|
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient |
Methods inherited from class org.restlet.representation.RepresentationInfo |
---|
getModificationDate, getTag, setModificationDate, setTag |
Methods inherited from class org.restlet.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 GsonRepresentation(Representation representation, java.lang.Class<T> objectClass)
representation
- The representation to parse.objectClass
- The object class to instantiate.public GsonRepresentation(T object)
object
- The object to format.Method Detail |
---|
protected com.google.gson.GsonBuilder createBuilder()
public com.google.gson.GsonBuilder getBuilder()
public T getObject() throws java.io.IOException
java.io.IOException
public java.lang.Class<T> getObjectClass()
public void setBuilder(com.google.gson.GsonBuilder builder)
builder
- The Gson builder.public void setObject(T object)
object
- The object to format.public void setObjectClass(java.lang.Class<T> objectClass)
objectClass
- The object class to instantiate.public void write(java.io.Writer writer) throws java.io.IOException
write
in class Representation
java.io.IOException
|
Restlet Framework 2.2.3 Android |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |