Visitor
public interface ASTVisitor extends Visitor
A Visitor which handles nodes in Derby's abstract syntax trees. In addition to this contract, it is expected that an ASTVisitor will have a 0-arg constructor. You use an ASTVisitor like this:
// initialize your visitor MyASTVisitor myVisitor = new MyASTVisitor(); myVisitor.initializeVisitor(); languageConnectionContext.setASTVisitor( myVisitor ); // then run your queries. ... // when you're done inspecting query trees, release resources and // remove your visitor languageConnectionContext.setASTVisitor( null ); myVisitor.teardownVisitor();
Modifier and Type | Field | Description |
---|---|---|
static int |
AFTER_BIND |
|
static int |
AFTER_OPTIMIZE |
|
static int |
AFTER_PARSE |
Modifier and Type | Method | Description |
---|---|---|
void |
begin(java.lang.String statementText,
int phase) |
The compiler calls this method just before walking a query tree.
|
void |
end(int phase) |
The compiler calls this method when it's done walking a tree.
|
void |
initializeVisitor() |
Initialize the Visitor before processing any trees.
|
void |
teardownVisitor() |
Final call to the Visitor.
|
skipChildren, stopTraversal, visit, visitChildrenFirst
static final int AFTER_PARSE
static final int AFTER_BIND
static final int AFTER_OPTIMIZE
void initializeVisitor() throws StandardException
StandardException
void teardownVisitor() throws StandardException
StandardException
void begin(java.lang.String statementText, int phase) throws StandardException
statementText
- Text used to create the tree.phase
- of compilation (AFTER_PARSE, AFTER_BIND, or AFTER_OPTIMIZE).StandardException
void end(int phase) throws StandardException
phase
- of compilation (AFTER_PARSE, AFTER_BIND, or AFTER_OPTIMIZE).StandardException
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.