Interface Node

All Known Subinterfaces:
ButtonElement, ComponentNode, Element, ItemElement, TextNode

public interface Node
Represents a node in the DOM structure.

A node can be an element, text, component or an item element. Unlike, regular DOM implementations, attributes are not nodes.

See Also:
  • Method Details

    • getOwningDocument

      @NotNull @NotNull Document getOwningDocument()
      Gets the document that owns this node.
      Returns:
      Owning document.
    • getParent

      @Nullable @Nullable Element getParent()
      Gets the parent element of this node.
      Returns:
      Parent, or null
    • getSiblingIndex

      int getSiblingIndex()
      Gets the index of this element among its siblings.
      Returns:
      Sibling index, or -1, if no parent is set
    • nextSibling

      @Nullable @Nullable Node nextSibling()
      Gets the node immediately after this one in the parent's child list.
      Returns:
      Next sibling node, or null, if this node has no parent or if there is no sibling after this node.
    • previousSibling

      @Nullable @Nullable Node previousSibling()
      Gets the node immediately before this one in the parent's child list.
      Returns:
      Previous sibling node, or null, if this node has no parent or if there is no node before this one.
    • getDepth

      int getDepth()
      Gets the node's depth.

      Depth is a measure of how far away from the root element a node is.

      Returns:
      Node depth
    • hasFlag

      @Contract("null -> false") boolean hasFlag(NodeFlag flag)
      Test if the node has the specified flag set.
      Parameters:
      flag - Flag to test
      Returns:
      true, if the specified flag was set, false otherwise
    • enterVisitor

      void enterVisitor(Visitor visitor)
    • exitVisitor

      void exitVisitor(Visitor visitor)