|
||||||||||
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.resource.DomRepresentation
public class DomRepresentation
XML representation based on a DOM document. DOM is a standard XML object model defined by the W3C.
Field Summary |
---|
Fields inherited from class org.restlet.resource.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
DomRepresentation(MediaType mediaType)
Constructor for an empty document. |
|
DomRepresentation(MediaType mediaType,
org.w3c.dom.Document xmlDocument)
Constructor from an existing DOM document. |
|
DomRepresentation(Representation xmlRepresentation)
Constructor. |
Method Summary | |
---|---|
protected javax.xml.transform.Transformer |
createTransformer()
Creates a new JAXP Transformer object that will be used to serialize this DOM. |
java.lang.Object |
evaluate(java.lang.String expression,
javax.xml.namespace.QName returnType)
Evaluates an XPath expression and returns the result as in the given return type. |
org.w3c.dom.Document |
getDocument()
Returns the wrapped DOM document. |
javax.xml.transform.dom.DOMSource |
getDomSource()
Returns a DOM source. |
void |
release()
Releases the wrapped DOM document and the source XML representation if they have been defined. |
void |
setDocument(org.w3c.dom.Document dom)
Sets the wrapped DOM document. |
void |
write(java.io.OutputStream outputStream)
Writes the representation to a byte stream. |
Methods inherited from class org.restlet.resource.XmlRepresentation |
---|
getBoolean, getDocumentBuilder, getNamespaceURI, getNode, getNodes, getNumber, getPrefix, getPrefixes, getSaxSource, getSaxSource, getStreamSource, getText, isNamespaceAware, putNamespace, 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 DomRepresentation(MediaType mediaType) throws java.io.IOException
mediaType
- The representation's media type.
java.io.IOException
public DomRepresentation(MediaType mediaType, org.w3c.dom.Document xmlDocument)
mediaType
- The representation's media type.xmlDocument
- The source DOM document.public DomRepresentation(Representation xmlRepresentation)
xmlRepresentation
- A source XML representation to parse.Method Detail |
---|
protected javax.xml.transform.Transformer createTransformer() throws java.io.IOException
java.io.IOException
public java.lang.Object evaluate(java.lang.String expression, javax.xml.namespace.QName returnType) throws java.lang.Exception
XmlRepresentation
evaluate
in class XmlRepresentation
returnType
- The qualified name of the return type.
java.lang.Exception
XPathException
,
XPathConstants
public org.w3c.dom.Document getDocument() throws java.io.IOException
java.io.IOException
public javax.xml.transform.dom.DOMSource getDomSource() throws java.io.IOException
getDomSource
in class XmlRepresentation
java.io.IOException
public void release()
release
in class XmlRepresentation
public void setDocument(org.w3c.dom.Document dom)
dom
- The wrapped DOM document.public void write(java.io.OutputStream outputStream) throws java.io.IOException
Representation
write
in class Representation
outputStream
- The output stream.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |