java.lang.Object
com.aoapps.lang.reflect.Methods
Simplifies access to a reflection method.
- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
Invokes the provided method on the given object.static <T> T
invoke
(Class<T> returnType, Object target, String methodName, Class<?>[] parameterTypes, Object[] parameterValues) Invokes the provided method on the given object.static <T> T
invoke
(Class<T> returnType, Object target, String methodName, Class<?> parameterType, Object parameterValue) Invokes the provided method on the given object.
-
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
-