public class MethodWrap extends Object implements Interceptor, MethodHolder
| 构造器和说明 |
|---|
MethodWrap(AppContext ctx,
Class<?> clz,
Method m) |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
doIntercept(Invocation inv)
拦截处理
|
<T extends Annotation> |
getAnnotation(Class<T> type)
获取函数某种注解
|
Annotation[] |
getAnnotations()
获取函数所有注解
|
Class<?> |
getDeclaringClz()
获取申明类
|
ParameterizedType |
getGenericReturnType()
获取函数泛型类型
|
List<InterceptorEntity> |
getInterceptors()
获取拦截器
|
Method |
getMethod()
获取函数本身
|
String |
getName()
获取函数名
|
Class<?> |
getOwnerClz()
获取所有者类
|
Parameter[] |
getParameters()
获取函数原始参数
|
ParamWrap[] |
getParamWraps()
获取函数参数
|
Class<?> |
getReturnType()
获取函数反回类型
|
Object |
invoke(Object obj,
Object[] args)
执行(原生处理)
|
Object |
invokeByAspect(Object obj,
Object[] args)
执行切面(即带拦截器的处理)
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationClass)
检测是否存在注解
|
MethodWrap |
ofHandler()
初始化
|
ParamWrap[] |
paramWraps() |
public MethodWrap(AppContext ctx, Class<?> clz, Method m)
public ParamWrap[] paramWraps()
public MethodWrap ofHandler()
public String getName()
public Class<?> getOwnerClz()
getOwnerClz 在接口中 MethodHolderpublic Class<?> getDeclaringClz()
getDeclaringClz 在接口中 MethodHolderpublic Method getMethod()
getMethod 在接口中 MethodHolderpublic Class<?> getReturnType()
getReturnType 在接口中 MethodHolder@Nullable public ParameterizedType getGenericReturnType()
public ParamWrap[] getParamWraps()
getParamWraps 在接口中 MethodHolderpublic Parameter[] getParameters()
public Annotation[] getAnnotations()
getAnnotations 在接口中 MethodHolderpublic <T extends Annotation> T getAnnotation(Class<T> type)
getAnnotation 在接口中 MethodHolderpublic boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
public List<InterceptorEntity> getInterceptors()
getInterceptors 在接口中 MethodHolderpublic Object doIntercept(Invocation inv) throws Throwable
doIntercept 在接口中 Interceptorinv - 调用者Throwablepublic Object invoke(Object obj, Object[] args) throws Throwable
obj - 目标对象args - 执行参数ThrowableCopyright © 2024. All rights reserved.