org.restlet.resource
Class ObjectRepresentation
java.lang.Object
org.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
org.restlet.resource.OutputRepresentation
org.restlet.resource.ObjectRepresentation
public class ObjectRepresentation
- extends OutputRepresentation
Representation based on a serializable Java object.
- Author:
- Jerome Louvel (contact@noelios.com)
Methods inherited from class org.restlet.resource.Variant |
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getSize, getTag, setCharacterSet, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectRepresentation
public ObjectRepresentation(Representation serializedRepresentation)
throws IOException,
ClassNotFoundException,
IllegalArgumentException
- Constructor reading the object from a serialized representation. This
representation must have the proper media type:
"application/x-java-serialized-object".
- Parameters:
serializedRepresentation
- The serialized representation.
- Throws:
IOException
ClassNotFoundException
IllegalArgumentException
ObjectRepresentation
public ObjectRepresentation(Serializable object)
- Constructor
- Parameters:
object
- The serializable object.
getObject
public Object getObject()
throws IOException
- Returns the represented object.
- Returns:
- The represented object.
- Throws:
IOException
write
public void write(OutputStream outputStream)
throws IOException
- Writes the datum as a stream of bytes.
- Specified by:
write
in class OutputRepresentation
- Parameters:
outputStream
- The stream to use when writing.
- Throws:
IOException
Copyright © 2005-2007 Noelios Consulting.