public final class ReflectUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<java.lang.String,java.lang.reflect.Method> |
METHOD_CACHE
Method cache.
|
| Modifier | Constructor and Description |
|---|---|
private |
ReflectUtil()
Private constructor of utility class.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.reflect.Method |
getMethod(java.lang.Class<?> target,
java.lang.String name,
java.lang.Class<?>... parameters)
Gets the method defined on the target class.
|
static java.lang.Object |
invoke(java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object... parameters)
Invokes the method on the target object with the given parameters.
|
private static final java.util.Map<java.lang.String,java.lang.reflect.Method> METHOD_CACHE
public static java.lang.reflect.Method getMethod(java.lang.Class<?> target,
java.lang.String name,
java.lang.Class<?>... parameters)
target - Target class that contains method.name - Method name.parameters - Method parameters.public static java.lang.Object invoke(java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object... parameters)
target - Target class that contains method.method - Method to invoke on target.parameters - Method parameters.