org.apache.batik.dom

Class AbstractParentNode

public abstract class AbstractParentNode extends AbstractNode

This class implements the Node interface with support for children.
Nested Class Summary
protected classAbstractParentNode.ChildNodes
To manage the children of this node.
protected classAbstractParentNode.ElementsByTagName
To manage a list of nodes.
protected classAbstractParentNode.ElementsByTagNameNS
To manage a list of nodes.
Field Summary
protected AbstractParentNode.ChildNodeschildNodes
The children.
Method Summary
NodeappendChild(Node newChild)
DOM: Implements org.w3c.dom.Node#appendChild(Node).
protected voidcheckAndRemove(Node n, boolean replace)
Checks the validity of a node to be inserted, and removes it from the document if needed.
protected NodedeepCopyInto(Node n)
Deeply copy the fields of the current node into the given node.
protected NodedeepExport(Node n, AbstractDocument d)
Deeply exports this node to the given document.
protected voidfireDOMNodeInsertedEvent(Node node)
Fires a DOMNodeInserted event.
voidfireDOMNodeInsertedIntoDocumentEvent()
Recursively fires a DOMNodeInsertedIntoDocument event.
protected voidfireDOMNodeRemovedEvent(Node node)
Fires a DOMNodeRemoved event.
voidfireDOMNodeRemovedFromDocumentEvent()
Recursively fires a DOMNodeRemovedFromDocument event.
protected voidfireDOMSubtreeModifiedEvent()
Fires a DOMSubtreeModified event.
NodeListgetChildNodes()
DOM: Implements org.w3c.dom.Node#getChildNodes().
NodeListgetElementsByTagName(String name)
DOM: Implements org.w3c.dom.Element#getElementsByTagName(String).
NodeListgetElementsByTagNameNS(String namespaceURI, String localName)
DOM: Implements org.w3c.dom.Element#getElementsByTagNameNS(String,String).
NodegetFirstChild()
DOM: Implements org.w3c.dom.Node#getFirstChild().
NodegetLastChild()
DOM: Implements org.w3c.dom.Node#getLastChild().
StringgetTextContent()
DOM: Implements org.w3c.dom.Node#getTextContent().
booleanhasChildNodes()
DOM: Implements org.w3c.dom.Node#hasChildNodes().
NodeinsertBefore(Node newChild, Node refChild)
DOM: Implements org.w3c.dom.Node#insertBefore(Node, Node).
protected voidnodeAdded(Node n)
Called when a child node has been added.
protected voidnodeToBeRemoved(Node n)
Called when a child node is going to be removed.
voidnormalize()
DOM: Implements org.w3c.dom.Node#normalize().
NoderemoveChild(Node oldChild)
DOM: Implements org.w3c.dom.Node#removeChild(Node).
NodereplaceChild(Node newChild, Node oldChild)
DOM: Implements org.w3c.dom.Node#replaceChild(Node, Node).

Field Detail

childNodes

protected AbstractParentNode.ChildNodes childNodes
The children.

Method Detail

appendChild

public Node appendChild(Node newChild)
DOM: Implements org.w3c.dom.Node#appendChild(Node).

checkAndRemove

protected void checkAndRemove(Node n, boolean replace)
Checks the validity of a node to be inserted, and removes it from the document if needed.

deepCopyInto

protected Node deepCopyInto(Node n)
Deeply copy the fields of the current node into the given node.

Parameters: n a node of the type of this.

deepExport

protected Node deepExport(Node n, AbstractDocument d)
Deeply exports this node to the given document.

fireDOMNodeInsertedEvent

protected void fireDOMNodeInsertedEvent(Node node)
Fires a DOMNodeInserted event.

fireDOMNodeInsertedIntoDocumentEvent

public void fireDOMNodeInsertedIntoDocumentEvent()
Recursively fires a DOMNodeInsertedIntoDocument event.

fireDOMNodeRemovedEvent

protected void fireDOMNodeRemovedEvent(Node node)
Fires a DOMNodeRemoved event.

fireDOMNodeRemovedFromDocumentEvent

public void fireDOMNodeRemovedFromDocumentEvent()
Recursively fires a DOMNodeRemovedFromDocument event.

fireDOMSubtreeModifiedEvent

protected void fireDOMSubtreeModifiedEvent()
Fires a DOMSubtreeModified event.

getChildNodes

public NodeList getChildNodes()
DOM: Implements org.w3c.dom.Node#getChildNodes().

Returns: childNodes

getElementsByTagName

public NodeList getElementsByTagName(String name)
DOM: Implements org.w3c.dom.Element#getElementsByTagName(String).

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
DOM: Implements org.w3c.dom.Element#getElementsByTagNameNS(String,String).

getFirstChild

public Node getFirstChild()
DOM: Implements org.w3c.dom.Node#getFirstChild().

Returns: childNodes.firstChild

getLastChild

public Node getLastChild()
DOM: Implements org.w3c.dom.Node#getLastChild().

Returns: childNodes.lastChild

getTextContent

public String getTextContent()
DOM: Implements org.w3c.dom.Node#getTextContent().

hasChildNodes

public boolean hasChildNodes()
DOM: Implements org.w3c.dom.Node#hasChildNodes().

Returns: true if this node has children, false otherwise.

insertBefore

public Node insertBefore(Node newChild, Node refChild)
DOM: Implements org.w3c.dom.Node#insertBefore(Node, Node).

nodeAdded

protected void nodeAdded(Node n)
Called when a child node has been added.

nodeToBeRemoved

protected void nodeToBeRemoved(Node n)
Called when a child node is going to be removed.

normalize

public void normalize()
DOM: Implements org.w3c.dom.Node#normalize().

removeChild

public Node removeChild(Node oldChild)
DOM: Implements org.w3c.dom.Node#removeChild(Node).

replaceChild

public Node replaceChild(Node newChild, Node oldChild)
DOM: Implements org.w3c.dom.Node#replaceChild(Node, Node).
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.