public class Methods
extends java.lang.Object
| Constructor and Description |
|---|
Methods() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.reflect.Method |
getDeclaredMethod(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.Class<?>... parameterTypes)
Get a declared method of a class by its name and parameter types
|
static java.lang.reflect.Method[] |
getDeclaredMethods(java.lang.Class<?> clazz)
Get all declared methods of a class
|
static <T> T |
invoke(java.lang.Object instance,
java.lang.reflect.Method method,
java.lang.Object... args)
Invoke a method without any checks
|
static <I extends S,S,T> |
invokeSuper(I instance,
java.lang.Class<S> superClass,
java.lang.reflect.Method method,
java.lang.Object... args)
Invoke a super method without any checks
|
public static java.lang.reflect.Method[] getDeclaredMethods(java.lang.Class<?> clazz)
clazz - The class to get the methods frompublic static java.lang.reflect.Method getDeclaredMethod(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.Class<?>... parameterTypes)
clazz - The class to get the method fromname - The name of the methodparameterTypes - The parameter types of the methodpublic static <T> T invoke(java.lang.Object instance,
java.lang.reflect.Method method,
java.lang.Object... args)
instance - The instance to invoke the method onmethod - The method to invokeargs - The arguments to pass to the methodpublic static <I extends S,S,T> T invokeSuper(I instance,
java.lang.Class<S> superClass,
java.lang.reflect.Method method,
java.lang.Object... args)
instance - The instance to invoke the method onsuperClass - The super class to call the method ofmethod - The method to invokeargs - The arguments to pass to the method