Interface ReflectionResolver
-
- All Known Implementing Classes:
DefaultReflectionResolver
public interface ReflectionResolver
Interface for reflection resolvers that handle reflective method calls such asMethod.invoke(Object, Object...)
orConstructor.newInstance(Object...)
.- See the Checker Framework Manual:
- Reflection resolution
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isReflectiveMethodInvocation(com.sun.source.tree.MethodInvocationTree tree)
Returns true if the given tree represents a reflective method or constructor call.AnnotatedTypeFactory.ParameterizedExecutableType
resolveReflectiveCall(AnnotatedTypeFactory factory, com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeFactory.ParameterizedExecutableType origResult)
Resolve reflection and return the result offactory.methodFromUse
for the actual, resolved method or constructor call.
-
-
-
Field Detail
-
INIT
static final java.lang.String INIT
The "method name" of constructors.- See Also:
- Constant Field Values
-
INIT_LIST
static final java.util.List<java.lang.String> INIT_LIST
A list containing just the "method name" of constructors. Clients must not modify this list.
-
-
Method Detail
-
isReflectiveMethodInvocation
boolean isReflectiveMethodInvocation(com.sun.source.tree.MethodInvocationTree tree)
Returns true if the given tree represents a reflective method or constructor call.- Returns:
true
iff tree is a reflective method invocation,false
otherwise
-
resolveReflectiveCall
AnnotatedTypeFactory.ParameterizedExecutableType resolveReflectiveCall(AnnotatedTypeFactory factory, com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeFactory.ParameterizedExecutableType origResult)
Resolve reflection and return the result offactory.methodFromUse
for the actual, resolved method or constructor call. If the reflective method cannot be resolved the original result (origResult
) is returned.- Parameters:
factory
- the currently used AnnotatedTypeFactorytree
- the reflective invocation tree (m.invoke or c.newInstance)origResult
- the original result for the unresolved, reflective method call
-
-