|
||||||||||
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,
Document xmlDocument)
Constructor from an existing DOM document. |
|
DomRepresentation(Representation xmlRepresentation)
Constructor. |
Method Summary | |
---|---|
protected Transformer |
createTransformer()
Creates a new JAXP Transformer object that will be used to serialize this DOM. |
Object |
evaluate(String expression,
QName returnType)
Evaluates an XPath expression and returns the result as in the given return type. |
Document |
getDocument()
Returns the wrapped DOM document. |
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(Document dom)
Sets the wrapped DOM document. |
void |
write(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 IOException
mediaType
- The representation's media type.
IOException
public DomRepresentation(MediaType mediaType, 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 Transformer createTransformer() throws IOException
IOException
public Object evaluate(String expression, QName returnType) throws Exception
XmlRepresentation
evaluate
in class XmlRepresentation
returnType
- The qualified name of the return type.
Exception
XPathException
,
XPathConstants
public Document getDocument() throws IOException
IOException
public DOMSource getDomSource() throws IOException
getDomSource
in class XmlRepresentation
IOException
public void release()
release
in class XmlRepresentation
public void setDocument(Document dom)
dom
- The wrapped DOM document.public void write(OutputStream outputStream) throws IOException
Representation
write
in class Representation
outputStream
- The output stream.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |