|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.test4j.tools.reflector.MethodAccessor<T>
public class MethodAccessor<T>
| 构造方法摘要 | |
|---|---|
MethodAccessor(Class targetClaz,
String methodName,
Class... parametersType)
|
|
MethodAccessor(Method method)
|
|
MethodAccessor(Object target,
String methodName,
Class... parametersType)
|
|
| 方法摘要 | ||
|---|---|---|
Method |
getMethod()
|
|
T |
invoke(Object target,
Object[] args)
|
|
static
|
invokeMethod(Object target,
Method method,
Object... arguments)
Invokes the given method with the given parameters on the given target object |
|
static
|
invokeMethod(Object target,
String methodNmae,
Object... paras)
|
|
static
|
invokeMethodUnThrow(Object target,
Method method,
Object... arguments)
|
|
static
|
invokeMethodUnThrow(Object target,
String methodName,
Object... paras)
反射调用方法,不显式的抛出受检异常 原生的受检异常会被包装成运行时异常 |
|
T |
invokeStatic(Object[] args)
|
|
T |
invokeStaticUnThrow(Object[] args)
|
|
T |
invokeUnThrow(Object target,
Object[] args)
调用方法,不显式抛出异常 原方法如果有显式异常,将被封装 |
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public MethodAccessor(Class targetClaz,
String methodName,
Class... parametersType)
public MethodAccessor(Object target,
String methodName,
Class... parametersType)
targetObj - targetClazz - methodName - parametersType - public MethodAccessor(Method method)
| 方法详细信息 |
|---|
public Method getMethod()
public T invoke(Object target,
Object[] args)
throws Exception
Exception
public T invokeUnThrow(Object target,
Object[] args)
target - args -
public T invokeStatic(Object[] args)
throws Exception
Exceptionpublic T invokeStaticUnThrow(Object[] args)
public static <T> T invokeMethod(Object target,
Method method,
Object... arguments)
throws Exception
target - The object containing the method, not nullmethod - The method, not nullarguments - The method arguments
Test4JException - if the method could not be invoked
Exception
public static <T> T invokeMethodUnThrow(Object target,
Method method,
Object... arguments)
public static <T> T invokeMethod(Object target,
String methodNmae,
Object... paras)
throws Exception
Exception
public static <T> T invokeMethodUnThrow(Object target,
String methodName,
Object... paras)
T - target - methodName - paras -
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||