类 ReflectiveMethodAccessor

java.lang.Object
cn.taketoday.reflect.MethodInvoker
cn.taketoday.reflect.ReflectiveMethodAccessor
所有已实现的接口:
Accessor, Invoker, MethodAccessor

final class ReflectiveMethodAccessor extends MethodInvoker implements MethodAccessor
java reflect Method implementation
作者:
TODAY 2020/9/20 21:49
  • 字段详细资料

    • handleReflectionException

      private final boolean handleReflectionException
  • 构造器详细资料

    • ReflectiveMethodAccessor

      ReflectiveMethodAccessor(Method method, boolean handleReflectionException)
  • 方法详细资料

    • invoke

      public Object invoke(Object obj, Object[] args)
      从类复制的说明: MethodInvoker
      Invokes the underlying method represented by this Invoker object, on the specified object with the specified parameters. Individual parameters are automatically unwrapped to match primitive formal parameters, and both primitive and reference parameters are subject to method invocation conversions as necessary.

      If the underlying method is static, then the specified obj argument is ignored. It may be null.

      If the number of formal parameters required by the underlying method is 0, the supplied args array may be of length 0 or null.

      If the underlying method is static, the class that declared the method is initialized if it has not already been initialized.

      If the method completes normally, the value it returns is returned to the caller of invoke; if the value has a primitive type, it is first appropriately wrapped in an object. However, if the value has the type of array of a primitive type, the elements of the array are not wrapped in objects; in other words, an array of primitive type is returned. If the underlying method return type is void, the invocation returns null.

      指定者:
      invoke 在接口中 Invoker
      指定者:
      invoke 在类中 MethodInvoker
      参数:
      obj - the object the underlying method is invoked from
      args - the arguments used for the method call
      返回:
      the result of dispatching the method represented by this object on obj with parameters args