| 
||||||||||
| 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
fr.cnes.sitools.common.SitoolsXStreamRepresentation<T>
T - The type to wrap.public final class SitoolsXStreamRepresentation<T>
Representation based on the XStream library. It can serialize and deserialize automatically in XML. It also supports a bridge to JSON leveraging the Jettison library.
| Field Summary | 
|---|
| Fields inherited from class org.restlet.representation.Representation | 
|---|
UNKNOWN_SIZE | 
| Constructor Summary | |
|---|---|
SitoolsXStreamRepresentation(org.restlet.data.MediaType mediaType,
                             T object)
Constructor.  | 
|
SitoolsXStreamRepresentation(org.restlet.representation.Representation representation)
Constructor.  | 
|
SitoolsXStreamRepresentation(T object)
Constructor.  | 
|
| Method Summary | |
|---|---|
 java.lang.String | 
convertStreamToString(java.io.InputStream is)
Convert InputStream to String.  | 
 java.lang.Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> | 
getJsonDriverClass()
Returns the XStream JSON driver class.  | 
 T | 
getObject()
Get the object  | 
 T | 
getObject(java.lang.String rootNode)
FIXME Adding rootNode cause streaming to stop  | 
 java.lang.Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> | 
getXmlDriverClass()
Returns the XStream XML driver class.  | 
 com.thoughtworks.xstream.XStream | 
getXstream()
Returns the modifiable XStream object.  | 
 void | 
setJsonDriverClass(java.lang.Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> jsonDriverClass)
Sets the XStream JSON driver class.  | 
 void | 
setXmlDriverClass(java.lang.Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> xmlDriverClass)
Sets the XStream XML driver class.  | 
 void | 
setXstream(com.thoughtworks.xstream.XStream xstream)
Sets the XStream object.  | 
 void | 
write(java.io.Writer writer)
 | 
| Methods inherited from class org.restlet.representation.WriterRepresentation | 
|---|
getReader, release, write | 
| Methods inherited from class org.restlet.representation.CharacterRepresentation | 
|---|
getChannel, getStream, write | 
| Methods inherited from class org.restlet.representation.Representation | 
|---|
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDisposition, getDownloadName, getExpirationDate, getRange, getSize, getText, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDisposition, setDownloadable, setDownloadName, setExpirationDate, 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, getIdentifier, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setIdentifier, setIdentifier, setLanguages, setLocationRef, setLocationRef, setMediaType, toString | 
| Methods inherited from class java.lang.Object | 
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public SitoolsXStreamRepresentation(org.restlet.data.MediaType mediaType,
                                    T object)
mediaType - The target media type.object - The object to format.public SitoolsXStreamRepresentation(org.restlet.representation.Representation representation)
representation - The representation to parse.public SitoolsXStreamRepresentation(T object)
MediaType.APPLICATION_XML media type by default.
object - The object to format.| Method Detail | 
|---|
public java.lang.Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> getJsonDriverClass()
public T getObject()
public T getObject(java.lang.String rootNode)
rootNode - the root node
public java.lang.Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> getXmlDriverClass()
public com.thoughtworks.xstream.XStream getXstream()
public void setJsonDriverClass(java.lang.Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> jsonDriverClass)
jsonDriverClass - The XStream JSON driver class.public void setXmlDriverClass(java.lang.Class<? extends com.thoughtworks.xstream.io.HierarchicalStreamDriver> xmlDriverClass)
xmlDriverClass - The XStream XML driver class.public void setXstream(com.thoughtworks.xstream.XStream xstream)
xstream - The XStream object.
public void write(java.io.Writer writer)
           throws java.io.IOException
write in class org.restlet.representation.Representationjava.io.IOException
public java.lang.String convertStreamToString(java.io.InputStream is)
                                       throws java.io.IOException
is - the stream to convert
java.io.IOException - when reading error occurs
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||