Class DefaultReflectionResolver
- java.lang.Object
-
- org.checkerframework.common.reflection.DefaultReflectionResolver
-
- All Implemented Interfaces:
ReflectionResolver
public class DefaultReflectionResolver extends java.lang.Object implements ReflectionResolver
Default implementation ofReflectionResolver. It resolves calls to:Method.invoke(Object, Object...)Constructor.newInstance(Object...)
- See the Checker Framework Manual:
- Reflection resolution
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMSG_PREFEX_REFLECTIONMessage prefix added to verbose reflection messages.-
Fields inherited from interface org.checkerframework.common.reflection.ReflectionResolver
INIT, INIT_LIST
-
-
Constructor Summary
Constructors Constructor Description DefaultReflectionResolver(BaseTypeChecker checker, MethodValAnnotatedTypeFactory methodValProvider, boolean debug)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisReflectiveMethodInvocation(com.sun.source.tree.MethodInvocationTree tree)Returns true if the given tree represents a reflective method or constructor call.AnnotatedTypeFactory.ParameterizedExecutableTyperesolveReflectiveCall(AnnotatedTypeFactory factory, com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeFactory.ParameterizedExecutableType origResult)Resolve reflection and return the result offactory.methodFromUsefor the actual, resolved method or constructor call.
-
-
-
Field Detail
-
MSG_PREFEX_REFLECTION
public static final java.lang.String MSG_PREFEX_REFLECTION
Message prefix added to verbose reflection messages.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultReflectionResolver
public DefaultReflectionResolver(BaseTypeChecker checker, MethodValAnnotatedTypeFactory methodValProvider, boolean debug)
-
-
Method Detail
-
isReflectiveMethodInvocation
public boolean isReflectiveMethodInvocation(com.sun.source.tree.MethodInvocationTree tree)
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, com.sun.source.tree.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
-
-