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.ParentNode
All Implemented Interfaces:
IParentNode, org.w3c.dom.Node, org.w3c.dom.NodeList
Direct Known Subclasses:
ElementImpl, RootNode

public abstract class ParentNode
extends NodeImpl
implements org.w3c.dom.NodeList, IParentNode


Field Summary
protected  NodeImpl firstChild
           
protected  NodeImpl lastChild
           
 
Fields inherited from class org.apache.axiom.om.impl.dom.NodeImpl
factory, FIRSTCHILD, flags, HAS_PARENT, SPECIFIED
 
Fields inherited from interface org.apache.axiom.om.impl.common.IParentNode
COMPLETE, DISCARDED, INCOMPLETE
 
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
 
Constructor Summary
protected ParentNode(OMFactory factory)
           
 
Method Summary
 void addChild(OMNode omNode)
           
 void addChild(OMNode omNode, boolean fromBuilder)
           
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
           
 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)
           
 java.util.Iterator getDescendants(boolean includeSelf)
           
 org.w3c.dom.Node getFirstChild()
          Gets the first child of this Node, or null if none.
 OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
          Returns the first OMElement child node.
 OMNode getFirstOMChild()
           
 OMNode getFirstOMChildIfAvailable()
           
 org.w3c.dom.Node getLastChild()
          Gets the last child of this Node, or null if none.
 OMNode getLastKnownOMChild()
           
 int getLength()
           
 javax.xml.transform.sax.SAXSource getSAXSource(boolean cache)
           
 java.lang.String getTextContent()
           
 javax.xml.stream.XMLStreamReader getXMLStreamReader()
           
 javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache)
           
 javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration configuration)
           
 javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
           
 boolean hasChildNodes()
           
 org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
          Inserts newChild before the refChild.
 org.w3c.dom.Node item(int index)
           
 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(OMNode firstChild)
           
 void setLastChild(OMNode omNode)
          Forcefully set the last child
 void setTextContent(java.lang.String textContent)
           
 
Methods inherited from class org.apache.axiom.om.impl.dom.NodeImpl
buildWithAttachments, clone, cloneNode, close, compareDocumentPosition, detach, getAttributes, getBaseURI, getBuilder, getFeature, getLocalName, getNamespaceURI, getNextOMSiblingIfAvailable, getNodeValue, getOMFactory, getOwnerDocument, getParent, getParentNode, getPrefix, getPreviousOMSibling, getPreviousSibling, getUserData, hasAttributes, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerialize, internalSerializeAndConsume, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupPrefix, normalize, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setNodeValue, setParent, setParent, setPrefix, setPreviousOMSibling, 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.common.IParentNode
getBuilder, getState, isComplete
 
Methods inherited from interface org.w3c.dom.Node
getNextSibling, getNodeName, getNodeType, lookupNamespaceURI
 

Field Detail

firstChild

protected NodeImpl firstChild

lastChild

protected NodeImpl lastChild
Constructor Detail

ParentNode

protected ParentNode(OMFactory factory)
Method Detail

addChild

public void addChild(OMNode omNode)

addChild

public void addChild(OMNode omNode,
                     boolean fromBuilder)

getChildren

public java.util.Iterator getChildren()

getDescendants

public java.util.Iterator getDescendants(boolean includeSelf)

getChildrenWithName

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

Throws:
OMException
See Also:
(javax.xml.namespace.QName)

getChildrenWithLocalName

public java.util.Iterator getChildrenWithLocalName(java.lang.String localName)

getChildrenWithNamespaceURI

public java.util.Iterator getChildrenWithNamespaceURI(java.lang.String uri)

getFirstChildWithName

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

Throws:
OMException
See Also:
(javax.xml.namespace.QName)

getFirstOMChild

public OMNode getFirstOMChild()

getFirstOMChildIfAvailable

public OMNode getFirstOMChildIfAvailable()
Specified by:
getFirstOMChildIfAvailable in interface IParentNode

getLastKnownOMChild

public OMNode getLastKnownOMChild()

setFirstChild

public void setFirstChild(OMNode firstChild)

setLastChild

public void setLastChild(OMNode omNode)
Forcefully set the last child

Parameters:
omNode -

getChildNodes

public final org.w3c.dom.NodeList getChildNodes()
Specified by:
getChildNodes in interface org.w3c.dom.Node

getLength

public final int getLength()
Specified by:
getLength in interface org.w3c.dom.NodeList

item

public final org.w3c.dom.Node item(int index)
Specified by:
item in interface org.w3c.dom.NodeList

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

appendChild

public final org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
                                   throws org.w3c.dom.DOMException
Specified by:
appendChild in interface org.w3c.dom.Node
Throws:
org.w3c.dom.DOMException

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
Throws:
org.w3c.dom.DOMException

replaceChild

public final 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
Throws:
org.w3c.dom.DOMException

removeChild

public final 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
Throws:
org.w3c.dom.DOMException

getTextContent

public java.lang.String getTextContent()
                                throws org.w3c.dom.DOMException
Specified by:
getTextContent in interface org.w3c.dom.Node
Overrides:
getTextContent in class NodeImpl
Throws:
org.w3c.dom.DOMException

setTextContent

public void setTextContent(java.lang.String textContent)
                    throws org.w3c.dom.DOMException
Specified by:
setTextContent in interface org.w3c.dom.Node
Overrides:
setTextContent in class NodeImpl
Throws:
org.w3c.dom.DOMException

getXMLStreamReaderWithoutCaching

public javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader()

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache)

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache,
                                                           OMXMLStreamReaderConfiguration configuration)

getSAXSource

public javax.xml.transform.sax.SAXSource getSAXSource(boolean cache)


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.