public class Nodes extends Object
Modifier and Type | Field and Description |
---|---|
static NodeVisitor |
ALL |
Modifier and Type | Method and Description |
---|---|
static List<Node> |
asList(Node node)
Returns an unmodifiable list with the children of the specified node
|
static NodeVisitor |
visitAll()
A visitor that will visit all nodes.
|
static NodeVisitor |
visitChildren()
A visitor that will visit only children nodes.
|
static NodeVisitor |
visitNodes(int depth)
Creates a
NodeVisitor which will visit nodes up to the specified depth. |
static NodeVisitor |
visitNodes(NodePath path)
Creates a
NodeVisitor which will visit nodes matching the path. |
static NodeVisitor |
visitNodes(NodePath path,
NodeVisitor visitor)
Creates a
NodeVisitor which will visit nodes matching the path. |
static NodeVisitor |
visitNone()
A visitor that will not visit any nodes.
|
public static final NodeVisitor ALL
public static List<Node> asList(Node node)
node
- the parent nodepublic static NodeVisitor visitNone()
public static NodeVisitor visitChildren()
public static NodeVisitor visitAll()
public static NodeVisitor visitNodes(int depth)
NodeVisitor
which will visit nodes up to the specified depth. It's best to use the methods
visitNone
, visitChildren
, or visitAll
for values of 0, 1, and -1 respectively.depth
- the depth. A value less then 0 will visit all, i.e. visitAll
public static NodeVisitor visitNodes(NodePath path)
NodeVisitor
which will visit nodes matching the path. Each matching segment will load all children
until the end of the path is met, in which nothing else is loaded.path
- the path to the nodepublic static NodeVisitor visitNodes(NodePath path, NodeVisitor visitor)
NodeVisitor
which will visit nodes matching the path. Each matching segment will load all children
until the end of the path is met, in which the visitor parameter is used to determine further visiting.
Common use is to load the children once the path is met, so calling
visitNodes(NodePath.path("foo", "bar"), visitChildren())
would load the node for the given path and it's
children.
visitor
- the visitor object used once the path is met.path
- the path to the nodeCopyright © 2013 JBoss by Red Hat. All Rights Reserved.