public class DomRepresentation extends Representation
UNKNOWN_SIZE
Constructor and Description |
---|
DomRepresentation(MediaType mediaType)
Constructor for an empty document.
|
DomRepresentation(MediaType mediaType,
Document xmlDocument)
Constructor from an existing DOM document.
|
DomRepresentation(Representation xmlRepresentation)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Document |
getDocument()
Returns the wrapped DOM document.
|
Reader |
getReader() |
InputStream |
getStream() |
String |
getText() |
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.
|
append, exhaust, getAvailableSize, getDisposition, getExpirationDate, getRange, getSize, hasKnownSize, isAvailable, isEmpty, isTransient, setAvailable, setDisposition, setExpirationDate, setRange, setSize, setTransient
getModificationDate, getTag, setModificationDate, setTag
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
public DomRepresentation(MediaType mediaType)
mediaType
- The representation's media type.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.public Document getDocument() throws IOException
IOException
public Reader getReader() throws IOException
getReader
in class Representation
IOException
public InputStream getStream() throws IOException
getStream
in class Representation
IOException
public String getText() throws IOException
getText
in class Representation
IOException
public void release()
release
in class Representation
public void setDocument(Document dom)
dom
- The wrapped DOM document.Copyright © 2005-2014 Restlet.