| 
||||||||||
| 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.SitoolsJacksonRepresentation<T>
T - The type to wrap.public final class SitoolsJacksonRepresentation<T>
Representation based on the JACKSON library. It can serialize and unserialize automatically to JSON.
| Field Summary | 
|---|
| Fields inherited from class org.restlet.representation.Representation | 
|---|
UNKNOWN_SIZE | 
| Constructor Summary | |
|---|---|
SitoolsJacksonRepresentation(org.restlet.data.MediaType mediaType,
                             T object)
Constructor.  | 
|
SitoolsJacksonRepresentation(org.restlet.representation.Representation representation,
                             java.lang.Class<T> objectClass)
Constructor.  | 
|
SitoolsJacksonRepresentation(T object)
Constructor.  | 
|
| Method Summary | |
|---|---|
 java.lang.String | 
convertStreamToString(java.io.InputStream is)
Converts a stream into a simple string  | 
 T | 
getObject()
Returns the wrapped object, deserializing the representation with Jackson if necessary.  | 
 T | 
getObject(java.lang.String rootNode)
Get the object  | 
 java.lang.Class<T> | 
getObjectClass()
Returns the object class to instantiate.  | 
 org.codehaus.jackson.map.ObjectMapper | 
getObjectMapper()
Returns the modifiable Jackson object mapper.  | 
 void | 
setObject(T object)
Sets the object to format.  | 
 void | 
setObjectClass(java.lang.Class<T> objectClass)
Sets the object class to instantiate.  | 
 void | 
setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
Sets the Jackson object mapper.  | 
 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 SitoolsJacksonRepresentation(org.restlet.data.MediaType mediaType,
                                    T object)
mediaType - The target media type.object - The object to format.
public SitoolsJacksonRepresentation(org.restlet.representation.Representation representation,
                                    java.lang.Class<T> objectClass)
representation - The representation to parse.objectClass - class of the object to parsepublic SitoolsJacksonRepresentation(T object)
object - The object to format.| Method Detail | 
|---|
public T getObject()
public T getObject(java.lang.String rootNode)
rootNode - the node where you have root
public java.lang.Class<T> getObjectClass()
public org.codehaus.jackson.map.ObjectMapper getObjectMapper()
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 setObjectMapper(org.codehaus.jackson.map.ObjectMapper objectMapper)
objectMapper - The Jackson object mapper.
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 input stream
java.io.IOException - when a problem occurs in reading the stream
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||