org.apache.axiom.om.impl.dom
Class ParentNode

java.lang.Object
  extended by org.apache.axiom.om.impl.dom.NodeImpl
      extended by org.apache.axiom.om.impl.dom.ChildNode
          extended by org.apache.axiom.om.impl.dom.ParentNode
All Implemented Interfaces:
java.lang.Cloneable, org.apache.axiom.om.impl.OMContainerEx, org.apache.axiom.om.impl.OMNodeEx, org.apache.axiom.om.OMContainer, org.apache.axiom.om.OMNode, org.w3c.dom.Node, org.w3c.dom.NodeList
Direct Known Subclasses:
DocumentFragmentImpl, DocumentImpl, ElementImpl

public abstract class ParentNode
extends ChildNode
implements org.apache.axiom.om.impl.OMContainerEx


Field Summary
protected  ChildNode firstChild
           
protected  ChildNode lastChild
           
 
Fields inherited from class org.apache.axiom.om.impl.dom.ChildNode
nextSibling, parentNode, previousSibling
 
Fields inherited from class org.apache.axiom.om.impl.dom.NodeImpl
builder, done, factory, FIRSTCHILD, flags, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.axiom.om.OMNode
DTD_NODE, PI_NODE, SPACE_NODE
 
Constructor Summary
protected ParentNode(DocumentImpl ownerDocument, org.apache.axiom.om.OMFactory factory)
           
protected ParentNode(org.apache.axiom.om.OMFactory factory)
           
 
Method Summary
 void addChild(org.apache.axiom.om.OMNode omNode)
           
 void buildNext()
           
 org.w3c.dom.Node cloneNode(boolean deep)
           
 org.w3c.dom.NodeList getChildNodes()
           
 java.util.Iterator getChildren()
           
 java.util.Iterator getChildrenWithLocalName(java.lang.String localName)
           
 java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
          Returns an iterator of child nodes having a given qname.
 java.util.Iterator getChildrenWithNamespaceURI(java.lang.String uri)
           
 org.w3c.dom.Node getFirstChild()
          Gets the first child of this Node, or null if none.
 org.apache.axiom.om.OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
          Returns the first OMElement child node.
 org.apache.axiom.om.OMNode getFirstOMChild()
           
 org.w3c.dom.Node getLastChild()
          Gets the last child of this Node, or null if none.
 boolean hasChildNodes()
           
protected  org.apache.axiom.om.OMNode importNode(org.apache.axiom.om.OMNode child)
          This method is intended only to be used by Axiom intenals when merging Objects from different Axiom implementations to the DOOM implementation.
 org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
          Inserts newChild before the refChild.
private  boolean isAncestor(org.w3c.dom.Node newNode)
           
 org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
          Removes the given child from the DOM Tree.
 org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
          Replaces the oldChild with the newChild.
 void setFirstChild(org.apache.axiom.om.OMNode omNode)
           
 void setLastChild(org.apache.axiom.om.OMNode omNode)
          Forcefully set the last child
 
Methods inherited from class org.apache.axiom.om.impl.dom.ChildNode
detach, discard, getNextOMSibling, getNextSibling, getParent, getParentNode, getPreviousOMSibling, getPreviousSibling, insertSiblingAfter, insertSiblingBefore, setNextOMSibling, setParent, setPreviousOMSibling
 
Methods inherited from class org.apache.axiom.om.impl.dom.NodeImpl
appendChild, build, buildWithAttachments, close, compareDocumentPosition, getAttributes, getBaseURI, getFeature, getLength, getLocalName, getNamespaceURI, getNodeValue, getOMFactory, getOwnerDocument, getPrefix, getTextContent, getUserData, hasAttributes, internalSerializeWithCache, isComplete, isDefaultNamespace, isEqualNode, isFirstChild, isFirstChild, isNormalized, isNormalized, isOwned, isOwned, isReadonly, isReadonly, isSameNode, isSpecified, isSpecified, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, parentNode, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNodeValue, setOwnerDocument, setPrefix, setTextContent, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.axiom.om.impl.OMContainerEx
setComplete
 
Methods inherited from interface org.apache.axiom.om.OMContainer
isComplete
 
Methods inherited from interface org.w3c.dom.Node
getNodeName, getNodeType
 
Methods inherited from interface org.apache.axiom.om.impl.OMNodeEx
internalSerialize, internalSerializeAndConsume, setType
 
Methods inherited from interface org.apache.axiom.om.OMNode
getType
 

Field Detail

firstChild

protected ChildNode firstChild

lastChild

protected ChildNode lastChild
Constructor Detail

ParentNode

protected ParentNode(DocumentImpl ownerDocument,
                     org.apache.axiom.om.OMFactory factory)
Parameters:
ownerDocument -

ParentNode

protected ParentNode(org.apache.axiom.om.OMFactory factory)
Method Detail

addChild

public void addChild(org.apache.axiom.om.OMNode omNode)
Specified by:
addChild in interface org.apache.axiom.om.OMContainer

buildNext

public void buildNext()
Specified by:
buildNext in interface org.apache.axiom.om.OMContainer

getChildren

public java.util.Iterator getChildren()
Specified by:
getChildren in interface org.apache.axiom.om.OMContainer

getChildrenWithName

public java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
                                       throws org.apache.axiom.om.OMException
Returns an iterator of child nodes having a given qname.

Specified by:
getChildrenWithName in interface org.apache.axiom.om.OMContainer
Throws:
org.apache.axiom.om.OMException
See Also:
(javax.xml.namespace.QName)

getChildrenWithLocalName

public java.util.Iterator getChildrenWithLocalName(java.lang.String localName)
Specified by:
getChildrenWithLocalName in interface org.apache.axiom.om.OMContainer

getChildrenWithNamespaceURI

public java.util.Iterator getChildrenWithNamespaceURI(java.lang.String uri)
Specified by:
getChildrenWithNamespaceURI in interface org.apache.axiom.om.OMContainer

getFirstChildWithName

public org.apache.axiom.om.OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
                                                    throws org.apache.axiom.om.OMException
Returns the first OMElement child node.

Specified by:
getFirstChildWithName in interface org.apache.axiom.om.OMContainer
Throws:
org.apache.axiom.om.OMException
See Also:
(javax.xml.namespace.QName)

getFirstOMChild

public org.apache.axiom.om.OMNode getFirstOMChild()
Specified by:
getFirstOMChild in interface org.apache.axiom.om.OMContainer

setFirstChild

public void setFirstChild(org.apache.axiom.om.OMNode omNode)
Specified by:
setFirstChild in interface org.apache.axiom.om.impl.OMContainerEx

setLastChild

public void setLastChild(org.apache.axiom.om.OMNode omNode)
Forcefully set the last child

Specified by:
setLastChild in interface org.apache.axiom.om.impl.OMContainerEx
Parameters:
omNode -

getChildNodes

public org.w3c.dom.NodeList getChildNodes()
Specified by:
getChildNodes in interface org.w3c.dom.Node
Overrides:
getChildNodes in class NodeImpl

getFirstChild

public org.w3c.dom.Node getFirstChild()
Description copied from class: NodeImpl
Gets the first child of this Node, or null if none.

By default we do not have any children, ParentNode overrides this.

Specified by:
getFirstChild in interface org.w3c.dom.Node
Overrides:
getFirstChild in class NodeImpl
See Also:
ParentNode

getLastChild

public org.w3c.dom.Node getLastChild()
Description copied from class: NodeImpl
Gets the last child of this Node, or null if none.

By default we do not have any children, ParentNode overrides this.

Specified by:
getLastChild in interface org.w3c.dom.Node
Overrides:
getLastChild in class NodeImpl
See Also:
ParentNode

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface org.w3c.dom.Node
Overrides:
hasChildNodes in class NodeImpl

insertBefore

public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
                                     org.w3c.dom.Node refChild)
                              throws org.w3c.dom.DOMException
Inserts newChild before the refChild. If the refChild is null then the newChild is made the last child.

Specified by:
insertBefore in interface org.w3c.dom.Node
Overrides:
insertBefore in class NodeImpl
Throws:
org.w3c.dom.DOMException

replaceChild

public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
                                     org.w3c.dom.Node oldChild)
                              throws org.w3c.dom.DOMException
Replaces the oldChild with the newChild.

Specified by:
replaceChild in interface org.w3c.dom.Node
Overrides:
replaceChild in class NodeImpl
Throws:
org.w3c.dom.DOMException

removeChild

public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
                             throws org.w3c.dom.DOMException
Removes the given child from the DOM Tree.

Specified by:
removeChild in interface org.w3c.dom.Node
Overrides:
removeChild in class NodeImpl
Throws:
org.w3c.dom.DOMException

isAncestor

private boolean isAncestor(org.w3c.dom.Node newNode)

cloneNode

public org.w3c.dom.Node cloneNode(boolean deep)
Specified by:
cloneNode in interface org.w3c.dom.Node
Overrides:
cloneNode in class ChildNode

importNode

protected org.apache.axiom.om.OMNode importNode(org.apache.axiom.om.OMNode child)
This method is intended only to be used by Axiom intenals when merging Objects from different Axiom implementations to the DOOM implementation.

Parameters:
child -