org.teiid.language.visitor
Class DelegatingHierarchyVisitor

java.lang.Object
  extended by org.teiid.language.visitor.AbstractLanguageVisitor
      extended by org.teiid.language.visitor.HierarchyVisitor
          extended by 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
DelegatingHierarchyVisitor(LanguageObjectVisitor preProcessingDelegate, LanguageObjectVisitor postProcessingDelegate)
           
 
Method Summary
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 ILanguageObject 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
 
Methods inherited from class org.teiid.language.visitor.AbstractLanguageVisitor
visit, visit, visit, visit, visit, visit, visit, visitNodes, visitNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 ILanguageObject instance to perform the Visitor's operation on that instance. This method can also be used by the subclass to visit any ILanguageObject instances that the given instance may contain.

Overrides:
visitNode in class AbstractLanguageVisitor
Parameters:
obj - an ILanguageObject 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 type
object - 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 type
object - The root of the object tree to perform visitation on


Copyright © 2011. All Rights Reserved.