Class DefaultReflectionResolver
java.lang.Object
org.checkerframework.common.reflection.DefaultReflectionResolver
- All Implemented Interfaces:
ReflectionResolver
Default implementation of
ReflectionResolver
. It resolves calls to:
- See the Checker Framework Manual:
- Reflection resolution
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Message prefix added to verbose reflection messages.Fields inherited from interface org.checkerframework.common.reflection.ReflectionResolver
INIT, INIT_LIST
-
Constructor Summary
ConstructorDescriptionDefaultReflectionResolver
(BaseTypeChecker checker, MethodValAnnotatedTypeFactory methodValProvider, boolean debug) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether the given tree represents a reflective method or constructor call.resolveReflectiveCall
(AnnotatedTypeFactory factory, MethodInvocationTree tree, AnnotatedTypeFactory.ParameterizedExecutableType origResult) Resolve reflection and return the result offactory.methodFromUse
for the actual, resolved method or constructor call.
-
Field Details
-
MSG_PREFEX_REFLECTION
Message prefix added to verbose reflection messages.- See Also:
-
-
Constructor Details
-
DefaultReflectionResolver
public DefaultReflectionResolver(BaseTypeChecker checker, MethodValAnnotatedTypeFactory methodValProvider, boolean debug)
-
-
Method Details
-
isReflectiveMethodInvocation
Description copied from interface:ReflectionResolver
Determines whether the given tree represents a reflective method or constructor call.- Specified by:
isReflectiveMethodInvocation
in interfaceReflectionResolver
- Returns:
true
iff tree is a reflective method invocation,false
otherwise
-
resolveReflectiveCall
public AnnotatedTypeFactory.ParameterizedExecutableType resolveReflectiveCall(AnnotatedTypeFactory factory, MethodInvocationTree tree, AnnotatedTypeFactory.ParameterizedExecutableType origResult) Description copied from interface:ReflectionResolver
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.- Specified by:
resolveReflectiveCall
in interfaceReflectionResolver
- 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
-