AbstractDocument is an abstract base class for tree
implementors to use for implementation inheritence.
| Modifier and Type | Field and Description |
|---|---|
| protected String | encoding
The encoding of this document as stated in the XML declaration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(Visitor
Visitor is the visitor.Implements org.
|
| public void | add(Element
is the element to be added element)Overrides org. Implements org. Element to this branch.
|
| public Document | addComment(String
is the text for the comment)Comment node.Implements org. Comment node with the given text to this
branch.
|
| public Element | addElement(String
is the name for the name)Element node.Overrides org. Implements org. Element node with the given name to this branch
and returns a reference to the new node.
|
| public Element | addElement(String
is the fully qualified name of the Element qualifiedName, String is the URI of the namespace to use namespaceURI)Overrides org. Implements org. Element node with the given qualified name and
namespace URI to this branch and returns a reference to the new node.
|
| public Element | addElement(QName
is the qualified name for the qName)Element node.Overrides org. Implements org. Element node with the given QNameto
this branch and returns a reference to the new node.
|
| public Document | addProcessingInstruction(String
is the target of the processing instruction target, String is the textual data (key/value pairs) of the processing
instruction data)Implements org. |
| public Document | addProcessingInstruction(String
is the target of the processing instruction target, Map<String, String> is a Map of the key / value pairs of the processing
instruction data)Implements org. |
| public String | |
| public Node | asXPathResult(Element
DOCUMENT ME! parent)Overrides org. Implements org.
|
| protected void | |
| protected void | childAdded(Node
DOCUMENT ME! node)Implements abstract org. |
| protected void | childRemoved(Node
DOCUMENT ME! node)Implements abstract org. |
| public Document | getDocument()
Overrides org. Implements org.
|
| public short | getNodeType()
Overrides org. Implements org. |
| public String | getPath(Element
is the parent context from which the relative path should
start. If the context is null or the context is not an
ancestor of this node then the path will be absolute and start
from the document and so begin with the '/' character. context)Implements org. |
| public String | getStringValue()
Overrides org. Implements org. |
| public String | getUniquePath(Element
is the parent context from which the path should start. If the
context is null or the context is not an ancestor of this node
then the path will start from the document and so begin with
the '/' character. context)Implements org. Returns the relative unique XPath expression from the given context which will return a nodeset of one node which is the current node. |
| public String | getXMLEncoding()
Implements org. null when unspecified or when it is not known (such as
when the Document was created in memory) or when the implementation does
not support this operation.
|
| public void | normalize()
Implements org. Text nodes in the full depth of the sub-tree
underneath this Node, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments, processing
instructions, CDATA sections, and entity references) separates
Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes.
|
| public boolean | remove(Element
is the element to be removed element)Overrides org. Implements org. Element if the node is an immediate
child of this branch.
|
| protected abstract void | |
| public void | setRootElement(Element
the new root element for this document rootElement)Implements org. |
| public void | setXMLEncoding(String
the encoding of the document enc)Implements org. |
| public String | |
| public void | write(Writer
is the out)Writer to output the XML toOverrides org. Implements org.
|
| encoding | back to summary |
|---|---|
| protected String encoding The encoding of this document as stated in the XML declaration | |
| AbstractDocument | back to summary |
|---|---|
| public AbstractDocument() | |
| accept | back to summary |
|---|---|
| public void accept(Visitor visitor) Implements org.
| |
| add | back to summary |
|---|---|
| public void add(Element element) Overrides org. Implements org. Doc from org. Adds the given
| |
| addComment | back to summary |
|---|---|
| public Document addComment(String comment) Implements org. Doc from org. Adds a new | |
| addElement | back to summary |
|---|---|
| public Element addElement(String name) Overrides org. Implements org. Doc from org. Adds a new | |
| addElement | back to summary |
|---|---|
| public Element addElement(String qualifiedName, String namespaceURI) Overrides org. Implements org. Doc from org. Adds a new | |
| addElement | back to summary |
|---|---|
| public Element addElement(QName qName) Overrides org. Implements org. Doc from org. Adds a new | |
| addProcessingInstruction | back to summary |
|---|---|
| public Document addProcessingInstruction(String target, String data) Implements org. Doc from org. Adds a processing instruction for the given target | |
| addProcessingInstruction | back to summary |
|---|---|
| public Document addProcessingInstruction(String target, Map<String, String> data) Implements org. Doc from org. Adds a processing instruction for the given target | |
| asXML | back to summary |
|---|---|
| public String asXML() Implements org. Doc from org.
| |
| asXPathResult | back to summary |
|---|---|
| public Node asXPathResult(Element parent) Overrides org. Implements org. Doc from org.
| |
| checkAddElementAllowed | back to summary |
|---|---|
| protected void checkAddElementAllowed(Element element) | |
| childAdded | back to summary |
|---|---|
| protected void childAdded(Node node) Implements abstract org. Doc from org. Called when a new child node has been added to me to allow any parent relationships to be created or events to be fired.
| |
| childRemoved | back to summary |
|---|---|
| protected void childRemoved(Node node) Implements abstract org. Doc from org. Called when a child node has been removed to allow any parent relationships to be deleted or events to be fired.
| |
| getDocument | back to summary |
|---|---|
| public Document getDocument() Overrides org. Implements org. Doc from org.
This method is an optional feature and may not be supported for all
| |
| getNodeType | back to summary |
|---|---|
| public short getNodeType() Overrides org. Implements org. Doc from org. Returns the code according to the type of node. This makes processing nodes polymorphically much easier as the switch statement can be used instead of multiple if (instanceof) statements.
| |
| getPath | back to summary |
|---|---|
| public String getPath(Element context) Implements org. Doc from org. Returns the relative XPath expression which will return a node set containing the given node such as a/b/@c. No indexing will be used to restrict the path if multiple elements with the same name occur on the path.
| |
| getStringValue | back to summary |
|---|---|
| public String getStringValue() Overrides org. Implements org. Doc from org. Returns the XPath string-value of this node. The behaviour of this method is defined in the XPath specification .
| |
| getUniquePath | back to summary |
|---|---|
| public String getUniquePath(Element context) Implements org. Doc from org. Returns the relative unique XPath expression from the given context which will return a nodeset of one node which is the current node. This method will use the XPath index operator to restrict the path if multiple elements with the same name occur on the path.
| |
| getXMLEncoding | back to summary |
|---|---|
| public String getXMLEncoding() Implements org. Doc from org. Return the encoding of this document, as part of the XML declaration This
is
| |
| normalize | back to summary |
|---|---|
| public void normalize() Implements org. Doc from org. Puts all | |
| remove | back to summary |
|---|---|
| public boolean remove(Element element) Overrides org. Implements org. Doc from org. Removes the given
| |
| rootElementAdded | back to summary |
|---|---|
| protected abstract void rootElementAdded(Element rootElement) Called to set the root element variable
| |
| setRootElement | back to summary |
|---|---|
| public void setRootElement(Element rootElement) Implements org. Doc from org. Sets the root element for this document
| |
| setXMLEncoding | back to summary |
|---|---|
| public void setXMLEncoding(String enc) Implements org. Doc from org. Sets the encoding of this document as it will appear in the XML declaration part of the document.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |
| write | back to summary |
|---|---|
| public void write(Writer out) throws IOException Overrides org. Implements org. Doc from org.
| |