public class Resolver
extends java.lang.Object
Constructor and Description |
---|
Resolver(javax.annotation.processing.ProcessingEnvironment env) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
buildMethodContext()
Build an instance of
Resolve$MethodResolutionContext . |
javax.lang.model.element.Element |
findClass(java.lang.String name,
com.sun.source.util.TreePath path)
Finds the class literal with name
name . |
javax.lang.model.element.VariableElement |
findField(java.lang.String name,
javax.lang.model.type.TypeMirror type,
com.sun.source.util.TreePath path)
Finds the field with name
name in a given type. |
javax.lang.model.element.Element |
findMethod(java.lang.String methodName,
javax.lang.model.type.TypeMirror receiverType,
com.sun.source.util.TreePath path,
java.util.List<javax.lang.model.type.TypeMirror> argumentTypes)
Finds the method element for a given name and list of expected parameter
types.
|
public javax.lang.model.element.VariableElement findField(java.lang.String name, javax.lang.model.type.TypeMirror type, com.sun.source.util.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 javax.lang.model.element.Element findClass(java.lang.String name, com.sun.source.util.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 javax.lang.model.element.Element findMethod(java.lang.String methodName, javax.lang.model.type.TypeMirror receiverType, com.sun.source.util.TreePath path, java.util.List<javax.lang.model.type.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 java.lang.Object buildMethodContext() throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchFieldException
Resolve$MethodResolutionContext
.java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchFieldException