Interface ReflectionResolver

All Known Implementing Classes:
DefaultReflectionResolver

public interface ReflectionResolver
Interface for reflection resolvers that handle reflective method calls such as Method.invoke(Object, Object...) or Constructor.newInstance(Object...).
See the Checker Framework Manual:
Reflection resolution
  • Field Details

    • INIT

      static final String INIT
      The "method name" of constructors.
      See Also:
    • INIT_LIST

      static final List<String> INIT_LIST
      A list containing just the "method name" of constructors. Clients must not modify this list.
  • Method Details

    • isReflectiveMethodInvocation

      boolean isReflectiveMethodInvocation(MethodInvocationTree tree)
      Determines whether the given tree represents a reflective method or constructor call.
      Returns:
      true iff tree is a reflective method invocation, false otherwise
    • resolveReflectiveCall

      Resolve reflection and return the result of factory.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 AnnotatedTypeFactory
      tree - the reflective invocation tree (m.invoke or c.newInstance)
      origResult - the original result for the unresolved, reflective method call