Interface Node

All Known Subinterfaces:
BodyElement, ButtonElement, CanvasElement, ComponentElement, DelphiElement, Element, HeadElement, InputElement, ItemElement, JavaObjectElement, OptionElement, ScriptElement, StyleElement, 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
    • getRenderingBounds

      @Nullable @Nullable RenderBounds getRenderingBounds()
      Get the rendering bounds for a node.

      Note: If the node has not been appended to a document, or if the getOwningDocument()'s view has not been spawned, then this will return null.

      The returned reference is not updated after it is returned.

      Returns:
      Node rendering bounds, or null, if the document's view has not been spawned.
    • enterVisitor

      void enterVisitor(Visitor visitor)
    • exitVisitor

      void exitVisitor(Visitor visitor)