public abstract class ParentNode extends NodeImpl implements NodeList, IParentNode
Modifier and Type | Field and Description |
---|---|
protected NodeImpl |
firstChild |
protected NodeImpl |
lastChild |
factory, FIRSTCHILD, flags, HAS_PARENT, SPECIFIED
COMPLETE, DISCARDED, INCOMPLETE
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
Modifier | Constructor and Description |
---|---|
protected |
ParentNode(OMFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(OMNode omNode) |
void |
addChild(OMNode omNode,
boolean fromBuilder) |
Node |
appendChild(Node newChild) |
NodeList |
getChildNodes() |
Iterator |
getChildren() |
Iterator |
getChildrenWithLocalName(String localName) |
Iterator |
getChildrenWithName(QName elementQName)
Returns an iterator of child nodes having a given qname.
|
Iterator |
getChildrenWithNamespaceURI(String uri) |
Iterator |
getDescendants(boolean includeSelf) |
Node |
getFirstChild()
Gets the first child of this Node, or null if none.
|
OMElement |
getFirstChildWithName(QName elementQName)
Returns the first OMElement child node.
|
OMNode |
getFirstOMChild() |
OMNode |
getFirstOMChildIfAvailable()
Get the first child if it is available.
|
Node |
getLastChild()
Gets the last child of this Node, or null if none.
|
OMNode |
getLastKnownOMChild() |
int |
getLength() |
SAXSource |
getSAXSource(boolean cache) |
String |
getTextContent() |
XMLStreamReader |
getXMLStreamReader() |
XMLStreamReader |
getXMLStreamReader(boolean cache) |
XMLStreamReader |
getXMLStreamReader(boolean cache,
OMXMLStreamReaderConfiguration configuration) |
XMLStreamReader |
getXMLStreamReaderWithoutCaching() |
boolean |
hasChildNodes() |
Node |
insertBefore(Node newChild,
Node refChild)
Inserts newChild before the refChild.
|
Node |
item(int index) |
Node |
removeChild(Node oldChild)
Removes the given child from the DOM Tree.
|
Node |
replaceChild(Node newChild,
Node oldChild)
Replaces the oldChild with the newChild.
|
void |
setFirstChild(OMNode firstChild) |
void |
setLastChild(OMNode omNode)
Forcefully set the last child
|
void |
setTextContent(String textContent) |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBuilder, getState, isComplete
getNextSibling, getNodeName, getNodeType, lookupNamespaceURI
protected ParentNode(OMFactory factory)
public void addChild(OMNode omNode)
public void addChild(OMNode omNode, boolean fromBuilder)
public Iterator getChildren()
public Iterator getDescendants(boolean includeSelf)
public Iterator getChildrenWithName(QName elementQName) throws OMException
OMException
(javax.xml.namespace.QName)
public OMElement getFirstChildWithName(QName elementQName) throws OMException
OMException
(javax.xml.namespace.QName)
public OMNode getFirstOMChild()
public OMNode getFirstOMChildIfAvailable()
IParentNode
OMSerializable.isComplete()
may return false
when called on the child.
In contrast to OMContainer.getFirstOMChild()
, this method will never modify
the state of the underlying parser.getFirstOMChildIfAvailable
in interface IParentNode
null
if the container has no children or
the builder has not yet started to build the first childpublic OMNode getLastKnownOMChild()
public void setFirstChild(OMNode firstChild)
public void setLastChild(OMNode omNode)
omNode
- public final NodeList getChildNodes()
getChildNodes
in interface Node
public Node getFirstChild()
NodeImpl
getFirstChild
in interface Node
getFirstChild
in class NodeImpl
ParentNode
public Node getLastChild()
NodeImpl
getLastChild
in interface Node
getLastChild
in class NodeImpl
ParentNode
public boolean hasChildNodes()
hasChildNodes
in interface Node
hasChildNodes
in class NodeImpl
public final Node appendChild(Node newChild) throws DOMException
appendChild
in interface Node
DOMException
public Node insertBefore(Node newChild, Node refChild) throws DOMException
insertBefore
in interface Node
DOMException
public final Node replaceChild(Node newChild, Node oldChild) throws DOMException
replaceChild
in interface Node
DOMException
public final Node removeChild(Node oldChild) throws DOMException
removeChild
in interface Node
DOMException
public String getTextContent() throws DOMException
getTextContent
in interface Node
getTextContent
in class NodeImpl
DOMException
public void setTextContent(String textContent) throws DOMException
setTextContent
in interface Node
setTextContent
in class NodeImpl
DOMException
public XMLStreamReader getXMLStreamReaderWithoutCaching()
public XMLStreamReader getXMLStreamReader()
public XMLStreamReader getXMLStreamReader(boolean cache)
public XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration configuration)
public SAXSource getSAXSource(boolean cache)
Copyright © 2004–2018 The Apache Software Foundation. All rights reserved.