Class Methods

java.lang.Object
com.aoapps.lang.reflect.Methods

public final class Methods extends Object
Simplifies access to a reflection method.
Author:
AO Industries, Inc.
  • Method Details

    • invoke

      public static <T> T invoke(Class<T> returnType, Object target, String methodName) throws ReflectionException
      Invokes the provided method on the given object. This is convenient, but not so fast. Where repeated calls will be made to the method, us the full reflection API.
      Throws:
      ReflectionException
    • invoke

      public static <T> T invoke(Class<T> returnType, Object target, String methodName, Class<?> parameterType, Object parameterValue) throws ReflectionException
      Invokes the provided method on the given object. This is convenient, but not so fast. Where repeated calls will be made to the method, us the full reflection API.
      Throws:
      ReflectionException
    • invoke

      public static <T> T invoke(Class<T> returnType, Object target, String methodName, Class<?>[] parameterTypes, Object[] parameterValues) throws ReflectionException
      Invokes the provided method on the given object. This is convenient, but not so fast. Where repeated calls will be made to the method, us the full reflection API.
      Throws:
      ReflectionException