Interface NodeNavigator
- All Known Implementing Classes:
Config, EntryNode, InvalidNode, Node, SectionNode, SimpleNode, VoidNode
Something that contains or references nodes and can be navigated.
Not all navigation options are universally-supported.
All nodes are node navigators, even if they are
All nodes are node navigators, even if they are
EntryNodes that do not support
children.
Entry nodes will return null for all child-based operations
(as if the requested node was simply not present).-
Method Summary
Modifier and TypeMethodDescription@Nullable NodeObtains the immediate child node at this (direct) key.@NotNull NodeObtains the current node represented by this navigator.default @Nullable NodeFetches a node at position inside the current node.default @Nullable NodeFetches a node at a path inside the current node.default @Nullable StringGets the raw value from the node at the given path.iterator()If this navigator represents a node with no children (e.g.Methods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
iterator
-
get
-
getCurrentNode
Obtains the current node represented by this navigator. If this navigator is itself a node, it should return itself.- Returns:
- The main node represented by this navigator
-
getNodeAt
Fetches a node at position inside the current node. If any stage represents a node with no children (e.g. an entry node) the result will be null.
In the following example, the two entry nodes can be obtained from the root with"first", "one"and"first", "two", "three"(respectively).first: one: value two: three: value- Parameters:
steps- The node steps to traverse- Returns:
- The node at the final step (or nothing)
-
getNodeAt
@Contract("null -> this") @Nullable default @Nullable Node getNodeAt(@Nullable @Nullable String path) Fetches a node at a path inside the current node. If any stage represents a node with no children (e.g. an entry node) the result will be null.
In the following example, the two entry nodes can be obtained from the root with"first.one"and"first.two.three"(respectively).first: one: value two: three: value
If the path isnullor empty, this node will be returned.- Parameters:
path- The path to the node, separated by.- Returns:
- The node at the path (or nothing)
- See Also:
-
getValue
-