|
||||||||||
| 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.StreamRepresentation
org.restlet.representation.OutputRepresentation
org.restlet.representation.ObjectRepresentation<T>
T - The class to serialize, see Serializablepublic class ObjectRepresentation<T extends Serializable>
Representation based on a serializable Java object.
| Field Summary |
|---|
| Fields inherited from class org.restlet.representation.Representation |
|---|
UNKNOWN_SIZE |
| Constructor Summary | |
|---|---|
ObjectRepresentation(Representation serializedRepresentation)
Constructor reading the object from a serialized representation. |
|
ObjectRepresentation(T object)
Constructor for the MediaType.APPLICATION_JAVA_OBJECT type. |
|
ObjectRepresentation(T object,
MediaType mediaType)
Constructor for either the MediaType.APPLICATION_JAVA_OBJECT type
or the MediaType.APPLICATION_XML type. |
|
| Method Summary | |
|---|---|
T |
getObject()
Returns the represented object. |
void |
release()
Releases the represented object. |
void |
setObject(T object)
Sets the represented object. |
void |
write(OutputStream outputStream)
Writes the representation to a byte stream. |
| Methods inherited from class org.restlet.representation.OutputRepresentation |
|---|
getChannel, getStream |
| Methods inherited from class org.restlet.representation.StreamRepresentation |
|---|
getReader, 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, 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 ObjectRepresentation(Representation serializedRepresentation)
throws IOException,
ClassNotFoundException,
IllegalArgumentException
serializedRepresentation - The serialized representation.
IOException
ClassNotFoundException
IllegalArgumentExceptionpublic ObjectRepresentation(T object)
MediaType.APPLICATION_JAVA_OBJECT type.
object - The serializable object.
public ObjectRepresentation(T object,
MediaType mediaType)
MediaType.APPLICATION_JAVA_OBJECT type
or the MediaType.APPLICATION_XML type. In the first case, the
Java Object Serialization mechanism is used, based on
ObjectOutputStream. In the latter case, the JavaBeans XML
serialization is used, based on XMLEncoder.
object - The serializable object.mediaType - The media type.| Method Detail |
|---|
public T getObject()
throws IOException
IOExceptionpublic void release()
release in class Representationpublic void setObject(T object)
object - The represented object.
public void write(OutputStream outputStream)
throws IOException
RepresentationOutputStream after writing to it as this will be handled by
the Restlet connectors automatically.
write in class RepresentationoutputStream - The output stream.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||