org.restlet.resource
Class ObjectRepresentation

java.lang.Object
  extended by org.restlet.resource.Variant
      extended by org.restlet.resource.Representation
          extended by org.restlet.resource.StreamRepresentation
              extended by org.restlet.resource.OutputRepresentation
                  extended by org.restlet.resource.ObjectRepresentation

public class ObjectRepresentation
extends OutputRepresentation

Representation based on a serializable Java object.

Author:
Jerome Louvel (contact@noelios.com)

Field Summary
 
Fields inherited from class org.restlet.resource.Variant
UNKNOWN_SIZE
 
Constructor Summary
ObjectRepresentation(Representation serializedRepresentation)
          Constructor reading the object from a serialized representation.
ObjectRepresentation(Serializable object)
          Constructor
 
Method Summary
 Object getObject()
          Returns the represented object.
 void write(OutputStream outputStream)
          Writes the datum as a stream of bytes.
 
Methods inherited from class org.restlet.resource.OutputRepresentation
getStream
 
Methods inherited from class org.restlet.resource.StreamRepresentation
getChannel, write
 
Methods inherited from class org.restlet.resource.Representation
getText, isAvailable, isTransient, setAvailable, setTransient
 
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
 

Constructor Detail

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.
Method Detail

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 Technologies.