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 Summary
Modifier and TypeMethodDescriptionvoid
enterVisitor
(Visitor visitor) void
exitVisitor
(Visitor visitor) int
getDepth()
Gets the node's depth.@NotNull Document
Gets the document that owns this node.@Nullable Element
Gets the parent element of this node.@Nullable RenderBounds
Get the rendering bounds for a node.int
Gets the index of this element among its siblings.boolean
Test if the node has the specifiedflag
set.@Nullable Node
Gets the node immediately after this one in the parent's child list.@Nullable Node
Gets the node immediately before this one in the parent's child list.
-
Method Details
-
getOwningDocument
Gets the document that owns this node.- Returns:
- Owning document.
-
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
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
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
Test if the node has the specifiedflag
set.- Parameters:
flag
- Flag to test- Returns:
true
, if the specified flag was set,false
otherwise
-
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 returnnull
.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
-
exitVisitor
-