public class DomRepresentation extends XmlRepresentation
XML_EXPANDING_ENTITY_REFS, XML_VALIDATING_DTD
UNKNOWN_SIZE
Constructor and Description |
---|
DomRepresentation()
Default constructor.
|
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.
|
Modifier and Type | Method and Description |
---|---|
protected javax.xml.transform.Transformer |
createTransformer()
Creates a new JAXP Transformer object that will be used to serialize this
DOM.
|
org.w3c.dom.Document |
getDocument()
Returns the wrapped DOM document.
|
javax.xml.transform.dom.DOMSource |
getDomSource()
Returns a DOM source.
|
org.xml.sax.InputSource |
getInputSource()
Returns the XML representation as a SAX input source.
|
boolean |
isIndenting()
Indicates if the XML serialization should be indented.
|
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 |
setIndenting(boolean indenting)
Indicates if the XML serialization should be indented.
|
void |
write(java.io.Writer writer) |
getBoolean, getDocumentBuilder, getEntityResolver, getErrorHandler, getNamespaces, getNamespaceURI, getNode, getNodes, getNumber, getPrefix, getPrefixes, getSaxSource, getSaxSource, getSchema, getStreamSource, getText, isCoalescing, isExpandingEntityRefs, isIgnoringComments, isIgnoringExtraWhitespaces, isNamespaceAware, isValidatingDtd, isXIncludeAware, setCoalescing, setEntityResolver, setErrorHandler, setExpandingEntityRefs, setIgnoringComments, setIgnoringExtraWhitespaces, setNamespaceAware, setNamespaces, setSchema, setSchema, setValidatingDtd, setXIncludeAware, validate, validate, validate, validate
getReader
getChannel, getStream, write, write
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient
getModificationDate, getTag, setModificationDate, setTag
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
public DomRepresentation() throws java.io.IOException
MediaType.TEXT_XML
media type.java.io.IOException
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.protected javax.xml.transform.Transformer createTransformer() throws java.io.IOException
java.io.IOException
public org.w3c.dom.Document getDocument() throws java.io.IOException
getDocument
in class XmlRepresentation
java.io.IOException
public javax.xml.transform.dom.DOMSource getDomSource() throws java.io.IOException
getDomSource
in class XmlRepresentation
java.io.IOException
public org.xml.sax.InputSource getInputSource() throws java.io.IOException
XmlRepresentation
getInputSource
in class XmlRepresentation
java.io.IOException
public boolean isIndenting()
public void release()
release
in class XmlRepresentation
public void setDocument(org.w3c.dom.Document dom)
dom
- The wrapped DOM document.public void setIndenting(boolean indenting)
indenting
- True if the XML serialization should be indented.public void write(java.io.Writer writer) throws java.io.IOException
write
in class Representation
java.io.IOException
Copyright © 2005-2020 Restlet.