Package org.teiid.query.sql.visitor
Class CommandCollectorVisitor
- java.lang.Object
-
- org.teiid.query.sql.LanguageVisitor
-
- org.teiid.query.sql.visitor.CommandCollectorVisitor
-
public class CommandCollectorVisitor extends LanguageVisitor
This visitor class will traverse a language object tree and collect all sub-commands it finds. It uses a List to collect the sub-commands in the order they're found.
The easiest way to use this visitor is to call the static methods which create the visitor, run the visitor, and get the collection. The public visit() methods should NOT be called directly.
-
-
Constructor Summary
Constructors Constructor Description CommandCollectorVisitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Command>
getCommands()
Get the commands collected by the visitor.static List<Command>
getCommands(Command command)
Helper to quickly get the commands from objstatic List<Command>
getCommands(Command command, boolean includeExpanded)
void
visit(BatchedUpdateCommand obj)
void
visit(ExistsCriteria obj)
void
visit(Insert obj)
void
visit(SubqueryCompareCriteria obj)
void
visit(SubqueryFromClause obj)
Visit a language object and collect symbols.void
visit(SubquerySetCriteria obj)
Visit a language object and collect symbols.void
visit(UnaryFromClause obj)
void
visit(WithQueryCommand obj)
void
visit(CommandStatement obj)
Visit a language object and collect symbols.void
visit(LoopStatement obj)
Visit a language object and collect symbols.void
visit(ScalarSubquery obj)
-
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
-
-
-
-
Method Detail
-
getCommands
public List<Command> getCommands()
Get the commands collected by the visitor. This should best be called after the visitor has been run on the language object tree.- Returns:
- List of
Command
-
visit
public void visit(ExistsCriteria obj)
- Overrides:
visit
in classLanguageVisitor
- See Also:
LanguageVisitor.visit(org.teiid.query.sql.lang.ExistsCriteria)
-
visit
public void visit(ScalarSubquery obj)
- Overrides:
visit
in classLanguageVisitor
-
visit
public void visit(SubqueryCompareCriteria obj)
- Overrides:
visit
in classLanguageVisitor
-
visit
public void visit(SubqueryFromClause obj)
Visit a language object and collect symbols. This method should NOT be called directly.- Overrides:
visit
in classLanguageVisitor
- Parameters:
obj
- Language object
-
visit
public void visit(SubquerySetCriteria obj)
Visit a language object and collect symbols. This method should NOT be called directly.- Overrides:
visit
in classLanguageVisitor
- Parameters:
obj
- Language object
-
visit
public void visit(CommandStatement obj)
Visit a language object and collect symbols. This method should NOT be called directly.- Overrides:
visit
in classLanguageVisitor
- Parameters:
obj
- Language object
-
visit
public void visit(LoopStatement obj)
Visit a language object and collect symbols. This method should NOT be called directly.- Overrides:
visit
in classLanguageVisitor
- Parameters:
obj
- Language object
-
visit
public void visit(BatchedUpdateCommand obj)
- Overrides:
visit
in classLanguageVisitor
-
visit
public void visit(WithQueryCommand obj)
- Overrides:
visit
in classLanguageVisitor
-
visit
public void visit(Insert obj)
- Overrides:
visit
in classLanguageVisitor
-
visit
public void visit(UnaryFromClause obj)
- Overrides:
visit
in classLanguageVisitor
-
getCommands
public static final List<Command> getCommands(Command command)
Helper to quickly get the commands from obj- Parameters:
command
- Language object
-
-