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
FieldsModifier and TypeFieldDescriptionstatic final StringMessage prefix added to verbose reflection messages.Fields inherited from interface org.checkerframework.common.reflection.ReflectionResolver
INIT, INIT_LIST -
Constructor Summary
ConstructorsConstructorDescriptionDefaultReflectionResolver(BaseTypeChecker checker, MethodValAnnotatedTypeFactory methodValProvider, boolean debug) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if 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.methodFromUsefor 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:ReflectionResolverReturns true if the given tree represents a reflective method or constructor call.- Specified by:
isReflectiveMethodInvocationin interfaceReflectionResolver- Returns:
trueiff tree is a reflective method invocation,falseotherwise
-
resolveReflectiveCall
public AnnotatedTypeFactory.ParameterizedExecutableType resolveReflectiveCall(AnnotatedTypeFactory factory, MethodInvocationTree tree, AnnotatedTypeFactory.ParameterizedExecutableType origResult) Description copied from interface:ReflectionResolverResolve reflection and return the result offactory.methodFromUsefor the actual, resolved method or constructor call. If the reflective method cannot be resolved the original result (origResult) is returned.- Specified by:
resolveReflectiveCallin 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
-