Package org.eclipse.lemminx.dom
Class DOMContainerNode
java.lang.Object
org.eclipse.lemminx.dom.DOMNode
org.eclipse.lemminx.dom.DOMTreeNode
org.eclipse.lemminx.dom.DOMContainerNode
- Direct Known Subclasses:
DOMDocument,DOMElement,DTDDeclNode
Base class for DOM nodes that can have children (elements, documents, DTD
declarations). Leaf nodes (text, comment, CDATA, processing instruction,
attribute) extend
DOMNode directly.-
Field Summary
Fields inherited from class org.eclipse.lemminx.dom.DOMNode
DTD_ATT_LIST_NODE, DTD_DECL_NODE, DTD_ELEMENT_DECL_NODE, DTD_ENTITY_DECL_NODE, DTD_NOTATION_DECL, NULL_VALUEFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd node child and set child.parent tothischildren()Returns an iterable over this node's children.findChildWithAttributeValue(String name, String value) Returns the first child having an attribute with the given name and value, or null if none found.findNodeAt(int offset) findNodeBefore(int offset) Returns the node beforegetChild(int index) Returns node child at the given index.Deprecated.booleanMethods inherited from class org.eclipse.lemminx.dom.DOMTreeNode
getEnd, getStart, isClosedMethods inherited from class org.eclipse.lemminx.dom.DOMNode
appendChild, attributes, cloneNode, compareDocumentPosition, findAttrAt, findAttrAt, findDTDDeclParameterAt, findDTDDeclParameterAt, findNodeOrAttrAt, findTextAt, getAttribute, getAttributeAtIndex, getAttributeNode, getAttributeNode, getAttributeNodes, getAttributes, getBaseURI, getFeature, getLastAttr, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOrphanEndElement, getOrphanEndElement, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousNonTextSibling, getPreviousSibling, getTextContent, getUserData, hasAttribute, hasAttributes, hasSiblings, hasSingleAttribute, insertBefore, isAttribute, isCDATA, isCharacterData, isChildOfOwnerDocument, isComment, isDefaultNamespace, isDoctype, isDTDAttListDecl, isDTDElementDecl, isDTDEntityDecl, isDTDNotationDecl, isElement, isEqualNode, isGenericDTDDecl, isIncluded, isIncluded, isOwnerDocument, isProcessingInstruction, isProlog, isSameNode, isSupported, isText, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setAttribute, setAttributeNode, setNodeValue, setPrefix, setTextContent, setUserData, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.Node
getNodeName, getNodeType
-
Constructor Details
-
DOMContainerNode
public DOMContainerNode(int start, int end)
-
-
Method Details
-
addChild
Description copied from class:DOMNodeAdd node child and set child.parent tothis -
children
Description copied from class:DOMNodeReturns an iterable over this node's children. Does not allocate a list. -
getChildren
Deprecated.Description copied from class:DOMNodeReturns the node children as a list.- Overrides:
getChildrenin classDOMNode- Returns:
- the node children.
-
getFirstChild
- Specified by:
getFirstChildin interfaceNode- Overrides:
getFirstChildin classDOMNode
-
getLastChild
- Specified by:
getLastChildin interfaceNode- Overrides:
getLastChildin classDOMNode
-
hasChildNodes
public boolean hasChildNodes()- Specified by:
hasChildNodesin interfaceNode- Overrides:
hasChildNodesin classDOMNode
-
getChildNodes
- Specified by:
getChildNodesin interfaceNode- Overrides:
getChildNodesin classDOMNode
-
getChild
Description copied from class:DOMNodeReturns node child at the given index. -
findNodeBefore
Description copied from class:DOMNodeReturns the node before- Overrides:
findNodeBeforein classDOMNode
-
findNodeAt
- Overrides:
findNodeAtin classDOMNode
-
findChildWithAttributeValue
Description copied from class:DOMNodeReturns the first child having an attribute with the given name and value, or null if none found.- Overrides:
findChildWithAttributeValuein classDOMNode- Parameters:
name- name of attributevalue- value of attribute- Returns:
- the first matching child, or null
-