Package org.teiid.query.sql.visitor
Class ReferenceCollectorVisitor
- java.lang.Object
-
- org.teiid.query.sql.LanguageVisitor
-
- org.teiid.query.sql.visitor.ReferenceCollectorVisitor
-
public class ReferenceCollectorVisitor extends LanguageVisitor
This visitor class will traverse a language object tree and collect all references it finds.
The easiest way to use this visitor is to call the static methods which create the visitor (and possibly the collection), run the visitor, and return the collection. The public visit() methods should NOT be called directly.
-
-
Constructor Summary
Constructors Constructor Description ReferenceCollectorVisitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Reference>
getReferences()
Get the references collected by the visitor.static List<Reference>
getReferences(LanguageObject obj)
Helper to quickly get the references from obj in a collection.void
visit(Reference obj)
Visit a language object and collect symbols.-
Methods inherited from class org.teiid.query.sql.LanguageVisitor
setAbort, shouldAbort, 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, 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, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
-
-
-
Method Detail
-
getReferences
public List<Reference> getReferences()
Get the references collected by the visitor. This should best be called after the visitor has been run on the language object tree.- Returns:
- Collection of
ElementSymbol
-
visit
public void visit(Reference obj)
Visit a language object and collect symbols. This method should NOT be called directly.- Overrides:
visit
in classLanguageVisitor
- Parameters:
obj
- Language object
-
getReferences
public static List<Reference> getReferences(LanguageObject obj)
Helper to quickly get the references from obj in a collection.- Parameters:
obj
- Language object- Returns:
- List of
Reference
-
-