|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
org.restlet.resource.OutputRepresentation
org.restlet.resource.XmlRepresentation
org.restlet.ext.jibx.JibxRepresentation<T>
T
- The type to wrap.public class JibxRepresentation<T>
An XML representation based on JIBX that provides easy translation between XML representations and Java objects with JIBX bindings.
Field Summary |
---|
Fields inherited from class org.restlet.resource.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
JibxRepresentation(MediaType mediaType,
T object)
Creates a JIBX representation from an existing Java object. |
|
JibxRepresentation(MediaType mediaType,
T object,
java.lang.String bindingName)
Creates a JIBX representation from an existing Java object. |
|
JibxRepresentation(Representation xmlRepresentation,
java.lang.Class bindingClass)
Creates a new JIBX representation, that can be used to convert the input XML into a Java object. |
|
JibxRepresentation(Representation xmlRepresentation,
java.lang.Class bindingClass,
java.lang.String bindingName)
Creates a new JIBX representation, that can be used to convert the input XML into a Java object. |
Method Summary | |
---|---|
java.lang.Object |
evaluate(java.lang.String expression,
javax.xml.namespace.QName returnType)
|
java.lang.String |
getEncoding()
Returns the document encoding to use for marshalling. |
T |
getObject()
Returns the wrapped Java object. |
void |
setEncoding(java.lang.String encoding)
|
void |
setObject(T object)
Sets the wrapped Java object. |
void |
write(java.io.OutputStream outputStream)
Marshals the document and writes the representation to a byte stream. |
Methods inherited from class org.restlet.resource.XmlRepresentation |
---|
getBoolean, getDocumentBuilder, getDomSource, getNamespaceURI, getNode, getNodes, getNumber, getPrefix, getPrefixes, getSaxSource, getSaxSource, getStreamSource, getText, isNamespaceAware, putNamespace, release, setNamespaceAware, validate, validate, validate, validate |
Methods inherited from class org.restlet.resource.OutputRepresentation |
---|
getStream |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, getReader, write, write |
Methods inherited from class org.restlet.resource.Representation |
---|
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDownloadName, getExpirationDate, getModificationDate, getRange, getSize, getTag, getText, isAvailable, isDownloadable, isTransient, setAvailable, setDigest, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setRange, setSize, setTag, setTransient |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getIdentifier, getLanguages, getMediaType, setCharacterSet, setEncodings, setIdentifier, setIdentifier, setLanguages, setMediaType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JibxRepresentation(MediaType mediaType, T object)
mediaType
- The representation's media type (usually
MediaType.APPLICATION_XML or MediaType.TEXT_XML).object
- The Java object.public JibxRepresentation(MediaType mediaType, T object, java.lang.String bindingName)
mediaType
- The representation's media type (usually
MediaType.APPLICATION_XML or MediaType.TEXT_XML).object
- The Java object.bindingName
- The name of the JIBX binding to use.public JibxRepresentation(Representation xmlRepresentation, java.lang.Class bindingClass)
xmlRepresentation
- The XML wrapped in a representation.bindingClass
- The Target Java class for binding.public JibxRepresentation(Representation xmlRepresentation, java.lang.Class bindingClass, java.lang.String bindingName)
xmlRepresentation
- The XML wrapped in a representation.bindingClass
- The Target Java class for binding.bindingName
- The name of the JIBX binding to use.Method Detail |
---|
public java.lang.Object evaluate(java.lang.String expression, javax.xml.namespace.QName returnType) throws java.lang.Exception
evaluate
in class XmlRepresentation
java.lang.Exception
public java.lang.String getEncoding()
public T getObject() throws JiBXException, java.io.IOException
JiBXException
- If unmarshalling XML with JIBX fails.
java.io.IOException
- If any error occurs attempting to get the stream of the
xmlRepresentation.public void setEncoding(java.lang.String encoding)
public void setObject(T object)
object
- The Java object to set.public void write(java.io.OutputStream outputStream) throws java.io.IOException
write
in class Representation
outputStream
- The output stream.
java.io.IOException
- If any error occurs attempting to write the stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |