Class ValueDescriptorNodeVisitor
java.lang.Object
de.xima.fc.interfaces.workflow.value.ValueDescriptorNodeVisitor
- All Implemented Interfaces:
TreeVisit.ITreeVisitor<ValueDescriptorNode<?,?>>
public abstract class ValueDescriptorNodeVisitor
extends Object
implements TreeVisit.ITreeVisitor<ValueDescriptorNode<?,?>>
Implements
TreeVisit.ITreeVisitor for ValueDescriptorNode and adds specific methods for each subtype of value
descriptor node. Can be used as a base class for visitors that need to handle specific node types. The default
implementation of each specific method does nothing and returns the default traversal behavior (i.e. to continue
traversal).- Since:
- 8.5.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface TreeVisit.ITreeVisitor
TreeVisit.ITreeVisitor.Pathless<Node> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterEnter(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path, TreeVisit.ETreeVisitResult result) Called after entering any node.protected voidafterExit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path, boolean result) Called after exiting any node.protected voidafterVisit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path, boolean result) Called after visiting any node.protected voidbeforeEnter(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Called before entering any node.protected voidbeforeExit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Called before exiting any node.protected voidbeforeVisit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Called before visiting any node.protected final StringWhentrackJsonPath()is enabled, builds the current JSON path as a string.enter(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters a tree node.protected TreeVisit.ETreeVisitResultenterListItem(ValueDescriptorNode.ListItem<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.ListItemnode.protected TreeVisit.ETreeVisitResultenterMapValue(ValueDescriptorNode.MapValue<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.MapValuenode.protected TreeVisit.ETreeVisitResultenterRecordKey(ValueDescriptorNode.RecordKey node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.RecordKeynode.protected TreeVisit.ETreeVisitResultenterRoot(ValueDescriptorNode.Root<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.Rootnode.protected TreeVisit.ETreeVisitResultenterTupleIndex(ValueDescriptorNode.TupleIndex node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.TupleIndexnode.protected TreeVisit.ETreeVisitResultenterUnionMember(ValueDescriptorNode.UnionMember node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.UnionMembernode.final booleanexit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exists a tree node.protected booleanexitListItem(ValueDescriptorNode.ListItem<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.ListItemnode.protected booleanexitMapValue(ValueDescriptorNode.MapValue<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.MapValuenode.protected booleanexitRecordKey(ValueDescriptorNode.RecordKey node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.RecordKeynode.protected booleanexitRoot(ValueDescriptorNode.Root<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.Rootnode.protected booleanexitTupleIndex(ValueDescriptorNode.TupleIndex node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.TupleIndexnode.protected booleanexitUnionMember(ValueDescriptorNode.UnionMember node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.UnionMembernode.protected booleanTemplates method to configure whether this visitor should track the current JSON path.final booleanvisit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits a tree node.protected booleanvisitListItem(ValueDescriptorNode.ListItem<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.ListItemnode.protected booleanvisitMapValue(ValueDescriptorNode.MapValue<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.MapValuenode.protected booleanvisitRecordKey(ValueDescriptorNode.RecordKey node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.RecordKeynode.protected booleanvisitRoot(ValueDescriptorNode.Root<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.Rootnode.protected booleanvisitTupleIndex(ValueDescriptorNode.TupleIndex node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.TupleIndexnode.protected booleanvisitUnionMember(ValueDescriptorNode.UnionMember node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.UnionMembernode.
-
Constructor Details
-
ValueDescriptorNodeVisitor
public ValueDescriptorNodeVisitor()
-
-
Method Details
-
enter
public final TreeVisit.ETreeVisitResult enter(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Description copied from interface:TreeVisit.ITreeVisitorEnters a tree node. This is called when the node is first reached, before any visitor methods are called on child nodes. SeeTreeVisitfor an example of the call order.- Specified by:
enterin interfaceTreeVisit.ITreeVisitor<ValueDescriptorNode<?,?>> - Parameters:
node- A tree node.path- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePathis set tofalse- Returns:
- How to proceed with the tree visit.
-
exit
public final boolean exit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Description copied from interface:TreeVisit.ITreeVisitorExists a tree node. This is called at the end, after all children were visited. No more visitor methods will be called on any children of the node. SeeTreeVisitfor an example of the call order.- Specified by:
exitin interfaceTreeVisit.ITreeVisitor<ValueDescriptorNode<?,?>> - Parameters:
node- A tree node.path- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePathis set tofalse- Returns:
trueto continue with the tree visit,falseto exit the visit (seeTreeVisit.ETreeVisitResult.QUIT).
-
visit
public final boolean visit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Description copied from interface:TreeVisit.ITreeVisitorVisits a tree node. This is called betweenenterandexit. SeeTreeVisitfor an example of the call order.- Specified by:
visitin interfaceTreeVisit.ITreeVisitor<ValueDescriptorNode<?,?>> - Parameters:
node- A tree node.path- The path of the node, i.e. all parents of the node. This is always an empty list whenincludePathis set tofalse- Returns:
trueto continue with the tree visit,falseto exit the visit (seeTreeVisit.ETreeVisitResult.QUIT).
-
afterEnter
protected void afterEnter(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path, TreeVisit.ETreeVisitResult result) Called after entering any node.- Parameters:
node- The node.path- The path to the node.result- The result of the enter method.
-
afterExit
protected void afterExit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path, boolean result) Called after exiting any node.- Parameters:
node- The node.path- The path to the node.result- The result of the exit method.
-
afterVisit
protected void afterVisit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path, boolean result) Called after visiting any node.- Parameters:
node- The node.path- The path to the node.result- The result of the visit method.
-
beforeEnter
protected void beforeEnter(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Called before entering any node.- Parameters:
node- The node.path- The path to the node.
-
beforeExit
protected void beforeExit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Called before exiting any node.- Parameters:
node- The node.path- The path to the node.
-
beforeVisit
protected void beforeVisit(ValueDescriptorNode<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Called before visiting any node.- Parameters:
node- The node.path- The path to the node.
-
buildJsonPath
WhentrackJsonPath()is enabled, builds the current JSON path as a string.- Returns:
- The current JSON path.
-
enterListItem
protected TreeVisit.ETreeVisitResult enterListItem(ValueDescriptorNode.ListItem<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.ListItemnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- The visit result that indicates how to proceed with the traversal.
-
enterMapValue
protected TreeVisit.ETreeVisitResult enterMapValue(ValueDescriptorNode.MapValue<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.MapValuenode.- Parameters:
node- The node.path- The path to the node.- Returns:
- The visit result that indicates how to proceed with the traversal.
-
enterRecordKey
protected TreeVisit.ETreeVisitResult enterRecordKey(ValueDescriptorNode.RecordKey node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.RecordKeynode.- Parameters:
node- The node.path- The path to the node.- Returns:
- The visit result that indicates how to proceed with the traversal.
-
enterRoot
protected TreeVisit.ETreeVisitResult enterRoot(ValueDescriptorNode.Root<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.Rootnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- The visit result that indicates how to proceed with the traversal.
-
enterTupleIndex
protected TreeVisit.ETreeVisitResult enterTupleIndex(ValueDescriptorNode.TupleIndex node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.TupleIndexnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- The visit result that indicates how to proceed with the traversal.
-
enterUnionMember
protected TreeVisit.ETreeVisitResult enterUnionMember(ValueDescriptorNode.UnionMember node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Enters aValueDescriptorNode.UnionMembernode.- Parameters:
node- The node.path- The path to the node.- Returns:
- The visit result that indicates how to proceed with the traversal.
-
exitListItem
protected boolean exitListItem(ValueDescriptorNode.ListItem<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.ListItemnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
exitMapValue
protected boolean exitMapValue(ValueDescriptorNode.MapValue<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.MapValuenode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
exitRecordKey
protected boolean exitRecordKey(ValueDescriptorNode.RecordKey node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.RecordKeynode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
exitRoot
protected boolean exitRoot(ValueDescriptorNode.Root<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.Rootnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
exitTupleIndex
protected boolean exitTupleIndex(ValueDescriptorNode.TupleIndex node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.TupleIndexnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
exitUnionMember
protected boolean exitUnionMember(ValueDescriptorNode.UnionMember node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Exits aValueDescriptorNode.UnionMembernode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
trackJsonPath
protected boolean trackJsonPath()Templates method to configure whether this visitor should track the current JSON path. Disabled by default. To enable, override this method to return true. When enabled, callbuildJsonPath()to get the current JSON path as a string.- Returns:
- True to track the JSON path, false otherwise.
-
visitListItem
protected boolean visitListItem(ValueDescriptorNode.ListItem<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.ListItemnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
visitMapValue
protected boolean visitMapValue(ValueDescriptorNode.MapValue<?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.MapValuenode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
visitRecordKey
protected boolean visitRecordKey(ValueDescriptorNode.RecordKey node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.RecordKeynode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
visitRoot
protected boolean visitRoot(ValueDescriptorNode.Root<?, ?> node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.Rootnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
visitTupleIndex
protected boolean visitTupleIndex(ValueDescriptorNode.TupleIndex node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.TupleIndexnode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-
visitUnionMember
protected boolean visitUnionMember(ValueDescriptorNode.UnionMember node, List<TreeVisit.TreePathFragment<ValueDescriptorNode<?, ?>>> path) Visits aValueDescriptorNode.UnionMembernode.- Parameters:
node- The node.path- The path to the node.- Returns:
- True to continue traversal, false to stop.
-