public abstract class ASTRequestor extends ObjectAn AST requestor handles ASTs for compilation units passed to
ASTRequestor.acceptASTis called for each of the compilation units passed to
ASTParser.createASTs. After all the compilation units have been processed,
ASTRequestor.acceptBindingsis called for each of the binding keys passed to
This class is intended to be subclassed by clients. AST requestors are serially reusable, but neither reentrant nor thread-safe.
Constructors Modifier Constructor Description
ASTRequestor()Creates a new instance.
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
acceptAST(ICompilationUnit source, CompilationUnit ast)Accepts an AST corresponding to the compilation unit.
acceptBinding(String bindingKey, IBinding binding)Accepts a binding corresponding to the binding key.
createBindings(String bindingKeys)Resolves bindings for the given binding keys.
public void acceptAST(ICompilationUnit source, CompilationUnit ast)Accepts an AST corresponding to the compilation unit. That is,
astis an AST for
The default implementation of this method does nothing. Clients should override to process the resulting AST.
source- the compilation unit the ast is coming from
ast- the requested abtract syntax tree
acceptBindingAccepts a binding corresponding to the binding key. That is,
bindingis the binding for
nullif the key cannot be resolved.
The default implementation of this method does nothing. Clients should override to process the resulting binding.
bindingKey- the key of the requested binding
binding- the requested binding, or
createBindingsResolves bindings for the given binding keys. The given binding keys must have been obtained earlier using
If a binding key cannot be resolved,
nullis put in the resulting array. Bindings can only be resolved in the dynamic scope of a
ASTParser.createASTs, and only if
Caveat: During an
acceptASTcallback, there are implementation limitations concerning the look up of binding keys representing local elements. In some cases, the binding is unavailable, and
nullwill be returned. This is only an issue during an
acceptASTcallback, and only when the binding key represents a local element (e.g., local variable, local class, method declared in anonymous class). There is no such limitation outside of
acceptASTcallbacks, or for top-level types and their members even within
bindingKeys- the binding keys to look up
- a list of bindings paralleling the
nullentries for keys that could not be resolved