|
||||||||||
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.Variant |
---|
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 | |
---|---|
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. |
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, getNamespaceURI, getNode, getNodes, getNumber, getPrefix, getPrefixes, getText, isNamespaceAware, putNamespace, setNamespaceAware |
Methods inherited from class org.restlet.resource.OutputRepresentation |
---|
getStream |
Methods inherited from class org.restlet.resource.StreamRepresentation |
---|
getChannel, write |
Methods inherited from class org.restlet.resource.Representation |
---|
getText, isAvailable, isTransient, setAvailable, setTransient |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getSize, getTag, setCharacterSet, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag |
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 |
---|
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 void setDocument(Document dom)
dom
- The wrapped DOM document.public void write(OutputStream outputStream) throws IOException
write
in class OutputRepresentation
outputStream
- The output stream.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |