public abstract static class Visitor.VisitorWithPath extends Object implements Visitor
Visitor.VisitorAdapter, Visitor.VisitorWithPath
Constructor and Description |
---|
Visitor.VisitorWithPath() |
Modifier and Type | Method and Description |
---|---|
WorkflowBean |
getCurrentNode()
Returns the
WorkflowBean currently visited. |
Stack<WorkflowBean> |
getCurrentPath()
Return the current path of
WorkflowBeans . |
abstract boolean |
visit()
Similar to
Visitor.visit(WorkflowBean) - but called for every
node, even if it can have children. |
boolean |
visit(WorkflowBean node)
Final to maintain current path.
|
boolean |
visitEnter(WorkflowBean node)
Final to maintain current path.
|
boolean |
visitLeave()
Override this method to be informed when leaving a node.
|
boolean |
visitLeave(WorkflowBean node)
Final to maintain current path.
|
public WorkflowBean getCurrentNode()
WorkflowBean
currently visited.WorkflowBean
currently visitedpublic Stack<WorkflowBean> getCurrentPath()
WorkflowBeans
.
The list will never contain the current node, which can instead be
found in getCurrentNode()
. That means that
Stack.peek()
will be the intermediate parent of the current
node.
The first object of the stack will be the initial object where
WorkflowBean.accept(Visitor)
was called, not necessarily the
WorkflowBundle
.
So for instance if you are in visit(WorkflowBean)
on an
InputProcessorPort
, getCurrentPath()
will have a
list [workflowBundle, workflow, processor]
. This should
generally match the path from following Child.getParent()
recursively.
This method returns the same List
instance throughout the use
of the visitor, it is dynamically modified by
visitEnter(WorkflowBean)
and
visitLeave(WorkflowBean)
.
List
of the current path of the ancestors of the
currently visiting WorkflowBean
.public abstract boolean visit()
Visitor.visit(WorkflowBean)
- but called for every
node, even if it can have children.
The current node is available in getCurrentNode()
.
true
if this node's children should be visited.
(return value is ignored for nodes which can't have children)public final boolean visit(WorkflowBean node)
visit()
instead.visit
in interface Visitor
node
- the currently visited WorkflowBean
true
if the visits over the current beans' siblings
should continue, false
to immediately leave the
parent.visit()
public final boolean visitEnter(WorkflowBean node)
visit()
instead.visitEnter
in interface Visitor
node
- the currently visited WorkflowBean
true
if the children of this bean should be visited.visit()
public boolean visitLeave()
Visitor.visitLeave(WorkflowBean)
, but also called
for nodes which can't have children.
The current node is present in getCurrentPath()
and can be
retrieved using getCurrentNode()
.
true
if the visits over the current beans'
siblings should continue, false
to immediately
leave the parent.public final boolean visitLeave(WorkflowBean node)
visitLeave()
instead.visitLeave
in interface Visitor
node
- the currently visited WorkflowBean
false
if the visits over the current beans' siblings
should continue, false
to immediately leave the
parent.visitLeave()
Copyright © 2014 myGrid. All rights reserved.