- 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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Tinvoke(Class<T> returnType, Object target, String methodName)Invokes the provided method on the given object.static <T> Tinvoke(Class<T> returnType, Object target, String methodName, Class<?>[] parameterTypes, Object[] parameterValues)Invokes the provided method on the given object.static <T> Tinvoke(Class<T> returnType, Object target, String methodName, Class<?> parameterType, Object parameterValue)Invokes the provided method on the given object.
-
-
-
Method Detail
-
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
-
-