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 . |
VariableElement |
findField(String name,
TypeMirror type,
TreePath path)
Finds the field with name
name in a given type. |
VariableElement |
findLocalVariableOrParameter(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.
|
public Resolver(ProcessingEnvironment env)
public 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 findLocalVariableOrParameter(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 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
.