public interface AssignmentHandler
TypeAnalyzer
.
Users may register assignment handlers (and other kinds of supported
handlers) to the TypeAnalyzer
used to analyze Java source code.
When the analyzer detects an assignment, it calls back those assignment
handlers after proper types are assigned to both the left-hand side and
the right-hand side of the assignment.
Assignment handlers are allowed to modify the assignment, either by modifying its children in the AST, or by replacing the whole assignment with another expression. This is because the handler is called after the subtree rooted at the assignment is completely visited by the analyzer. However, modifying any node out of this subtree (e.g., changing the parent of this assignment to another one) may cause unexpected effect.
Modifier and Type | Method and Description |
---|---|
void |
handle(org.eclipse.jdt.core.dom.Assignment node,
TypeAnalyzerState state)
Handle an assignment.
|
void |
handle(org.eclipse.jdt.core.dom.PostfixExpression node,
TypeAnalyzerState state)
Handle a postfix expression with a "++" operator or a "--" operator.
|
void |
handle(org.eclipse.jdt.core.dom.PrefixExpression node,
TypeAnalyzerState state)
Handle a prefix expression with a "++" operator or a "--" operator.
|
void handle(org.eclipse.jdt.core.dom.Assignment node, TypeAnalyzerState state)
node
- The assignment to be handled.state
- The current state of the analyzer.void handle(org.eclipse.jdt.core.dom.PostfixExpression node, TypeAnalyzerState state)
node
- The assignment to be handled.state
- The current state of the analyzer.void handle(org.eclipse.jdt.core.dom.PrefixExpression node, TypeAnalyzerState state)
node
- The assignment to be handled.state
- The current state of the analyzer.