public class Resolver extends Object
| Constructor and Description |
|---|
Resolver(ProcessingEnvironment env) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
buildMethodContext()
Build an instance of
Resolve$MethodResolutionContext. |
Element |
findClass(String name,
TreePath path)
Finds the class literal with name
name. |
com.sun.tools.javac.code.Symbol.ClassSymbol |
findClassInPackage(String name,
com.sun.tools.javac.code.Symbol.PackageSymbol pck,
TreePath path)
Finds the class with name
name in a given package. |
VariableElement |
findField(String name,
TypeMirror type,
TreePath path)
Finds the field with name
name in a given type. |
VariableElement |
findLocalVariableOrParameterOrField(String name,
TreePath path)
Finds the local variable with name
name in the given scope. |
Element |
findMethod(String methodName,
TypeMirror receiverType,
TreePath path,
List<TypeMirror> argumentTypes)
Finds the method element for a given name and list of expected parameter
types.
|
com.sun.tools.javac.code.Symbol.PackageSymbol |
findPackage(String name,
TreePath path)
Finds the package with name
name. |
public Resolver(ProcessingEnvironment env)
public com.sun.tools.javac.code.Symbol.PackageSymbol findPackage(String name, TreePath path)
name.name - The name of the package.path - The tree path to the local scope.PackageSymbol for the package if it is found,
null otherwisepublic VariableElement findField(String name, TypeMirror type, TreePath path)
name in a given type.
The method adheres to all the rules of Java's scoping (while also considering the imports) for name resolution.
name - The name of the field.type - The type of the receiver (i.e., the type in which to look for
the field).path - The tree path to the local scope.public VariableElement findLocalVariableOrParameterOrField(String name, TreePath path)
name in the given scope.name - The name of the local variable.path - The tree path to the local scope.public Element findClass(String name, TreePath path)
name.
The method adheres to all the rules of Java's scoping (while also considering the imports) for name resolution.
name - The name of the class.path - The tree path to the local scope.public com.sun.tools.javac.code.Symbol.ClassSymbol findClassInPackage(String name, com.sun.tools.javac.code.Symbol.PackageSymbol pck, TreePath path)
name in a given package.name - The name of the class.pck - The PackageSymbol for the package.path - The tree path to the local scope.ClassSymbol for the class if it is found,
null otherwisepublic Element findMethod(String methodName, TypeMirror receiverType, TreePath path, List<TypeMirror> argumentTypes)
The method adheres to all the rules of Java's scoping (while also considering the imports) for name resolution.
methodName - Name of the method to find.receiverType - Type of the receiver of the methodpath - Tree path.protected Object buildMethodContext() throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchFieldException
Resolve$MethodResolutionContext.