|
||||||||||
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,
String bindingName)
Creates a JIBX representation from an existing Java object. |
|
JibxRepresentation(Representation xmlRepresentation,
Class bindingClass)
Creates a new JIBX representation, that can be used to convert the input XML into a Java object. |
|
JibxRepresentation(Representation xmlRepresentation,
Class bindingClass,
String bindingName)
Creates a new JIBX representation, that can be used to convert the input XML into a Java object. |
Method Summary | |
---|---|
Object |
evaluate(String expression,
QName returnType)
|
String |
getEncoding()
Returns the document encoding to use for marshalling. |
T |
getObject()
Returns the wrapped Java object. |
void |
setEncoding(String encoding)
|
void |
setObject(T object)
Sets the wrapped Java object. |
void |
write(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, 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, Class bindingClass)
xmlRepresentation
- The XML wrapped in a representation.bindingClass
- The Target Java class for binding.public JibxRepresentation(Representation xmlRepresentation, Class bindingClass, 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 Object evaluate(String expression, QName returnType) throws Exception
evaluate
in class XmlRepresentation
Exception
public String getEncoding()
public T getObject() throws JiBXException, IOException
JiBXException
- If unmarshalling XML with JIBX fails.
IOException
- If any error occurs attempting to get the stream of the
xmlRepresentation.public void setEncoding(String encoding)
public void setObject(T object)
object
- The Java object to set.public void write(OutputStream outputStream) throws IOException
write
in class Representation
outputStream
- The output stream.
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 |