public interface MethodDeclarationHandler
TypeAnalyzer
.
Users may register method handlers (and other kinds of supported
handlers) to the TypeAnalyzer
used to analyze Java source code.
When the analyzer detects a method declaration, it calls back those
method handlers before and after proper types are assigned to all the
arguments.
exit(MethodDeclaration, TypeAnalyzerState)
of method handlers are
allowed to modify the method declaration, either by modifying its children
in the AST, or by replacing the whole method declaration with another valid
AST node. This is because the handler is called after the subtree rooted at
the method declaration is completely visited by the analyzer. However,
modifying any node out of this subtree (e.g., changing the parent of this
method declaration to another one) may cause unexpected effect.
enter(MethodDeclaration, TypeAnalyzerState)
should not modify the
method declaration.
Red (tfeng) |
Red (tfeng) |
Modifier and Type | Method and Description |
---|---|
void |
enter(org.eclipse.jdt.core.dom.MethodDeclaration node,
TypeAnalyzerState state)
Enter a method declaration.
|
void |
exit(org.eclipse.jdt.core.dom.MethodDeclaration node,
TypeAnalyzerState state)
Exit a method declaration.
|
void enter(org.eclipse.jdt.core.dom.MethodDeclaration node, TypeAnalyzerState state)
node
- The method declaration node.state
- The current state of the type analyzer.void exit(org.eclipse.jdt.core.dom.MethodDeclaration node, TypeAnalyzerState state)
node
- The method declaration node.state
- The current state of the type analyzer.