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, SPECIFIEDCOMPLETE, DISCARDED, INCOMPLETEATTRIBUTE_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, setUserDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBuilder, getState, isCompletegetNextSibling, getNodeName, getNodeType, lookupNamespaceURIprotected 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()
IParentNodeOMSerializable.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 IParentNodenull 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 Nodepublic Node getFirstChild()
NodeImplgetFirstChild in interface NodegetFirstChild in class NodeImplParentNodepublic Node getLastChild()
NodeImplgetLastChild in interface NodegetLastChild in class NodeImplParentNodepublic boolean hasChildNodes()
hasChildNodes in interface NodehasChildNodes in class NodeImplpublic final Node appendChild(Node newChild) throws DOMException
appendChild in interface NodeDOMExceptionpublic Node insertBefore(Node newChild, Node refChild) throws DOMException
insertBefore in interface NodeDOMExceptionpublic final Node replaceChild(Node newChild, Node oldChild) throws DOMException
replaceChild in interface NodeDOMExceptionpublic final Node removeChild(Node oldChild) throws DOMException
removeChild in interface NodeDOMExceptionpublic String getTextContent() throws DOMException
getTextContent in interface NodegetTextContent in class NodeImplDOMExceptionpublic void setTextContent(String textContent) throws DOMException
setTextContent in interface NodesetTextContent in class NodeImplDOMExceptionpublic XMLStreamReader getXMLStreamReaderWithoutCaching()
public XMLStreamReader getXMLStreamReader()
public XMLStreamReader getXMLStreamReader(boolean cache)
public XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration configuration)
public SAXSource getSAXSource(boolean cache)
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.