Package org.teiid.language.visitor
Class DelegatingHierarchyVisitor
- java.lang.Object
-
- org.teiid.language.visitor.AbstractLanguageVisitor
-
- org.teiid.language.visitor.HierarchyVisitor
-
- org.teiid.language.visitor.DelegatingHierarchyVisitor
-
- All Implemented Interfaces:
LanguageObjectVisitor
public class DelegatingHierarchyVisitor extends HierarchyVisitor
Delegates pre- and post-processing for each node in the hierarchy to delegate visitors.
-
-
Constructor Summary
Constructors Constructor Description DelegatingHierarchyVisitor(LanguageObjectVisitor preProcessingDelegate, LanguageObjectVisitor postProcessingDelegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LanguageObjectVisitor
getPostVisitor()
protected LanguageObjectVisitor
getPreVisitor()
static void
postOrderVisit(LanguageObjectVisitor behaviorVisitor, LanguageObject object)
This utility method can be used to execute the behaviorVisitor in a post-order walk of the language objects.static void
preOrderVisit(LanguageObjectVisitor behaviorVisitor, LanguageObject object)
This utility method can be used to execute the behaviorVisitor in a pre-order walk of the language objects.void
visitNode(LanguageObject obj)
Visit the LanguageObject instance to perform the Visitor's operation on that instance.-
Methods inherited from class org.teiid.language.visitor.HierarchyVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Methods inherited from class org.teiid.language.visitor.AbstractLanguageVisitor
visit, visit, visit, visit, visit, visit, visit, visitNodes, visitNodes
-
-
-
-
Constructor Detail
-
DelegatingHierarchyVisitor
public DelegatingHierarchyVisitor(LanguageObjectVisitor preProcessingDelegate, LanguageObjectVisitor postProcessingDelegate)
-
-
Method Detail
-
getPostVisitor
protected LanguageObjectVisitor getPostVisitor()
-
getPreVisitor
protected LanguageObjectVisitor getPreVisitor()
-
visitNode
public void visitNode(LanguageObject obj)
Description copied from class:AbstractLanguageVisitor
Visit the LanguageObject instance to perform the Visitor's operation on that instance. This method can also be used by the subclass to visit any LanguageObject instances that the given instance may contain.- Overrides:
visitNode
in classAbstractLanguageVisitor
- Parameters:
obj
- an LanguageObject instance- See Also:
HierarchyVisitor
-
preOrderVisit
public static void preOrderVisit(LanguageObjectVisitor behaviorVisitor, LanguageObject object)
This utility method can be used to execute the behaviorVisitor in a pre-order walk of the language objects. "Pre-order" in this case means that the visit method of the behaviorVisitor will be called before the visit method of it's children. It is expected that the behavior visit does NOT perform iteration, as that function will be performed by the HierarchyVisitor.- Parameters:
behaviorVisitor
- The visitor specifying what behavior is performed at each node typeobject
- The root of the object tree to perform visitation on
-
postOrderVisit
public static void postOrderVisit(LanguageObjectVisitor behaviorVisitor, LanguageObject object)
This utility method can be used to execute the behaviorVisitor in a post-order walk of the language objects. "Post-order" in this case means that the visit method of the behaviorVisitor will be called after the visit method of it's children. It is expected that the behavior visit does NOT perform iteration, as that function will be performed by the HierarchyVisitor.- Parameters:
behaviorVisitor
- The visitor specifying what behavior is performed at each node typeobject
- The root of the object tree to perform visitation on
-
-