intercept
Object intercept(T annotation,
Object object,
Method method,
Object[] params,
BeanMethodInterceptorChain interceptorChain)
throws Throwable
拦截器拦截某个方法时,使用该方法,在方法中通过逻辑决定是否继续调用拦截的方法,可以在调用之前和之后做一些业务上的操作
When an interceptor intercepts a method, the method is used to logically determine whether the intercepting method is called in the method,
and it can do some business operations before and after the call.
- 参数:
annotation - 拦截方法的注解实例/Annotation instances of the intercepting method.
object - 方法所属对象/Method owner
method - 方法定义/Method definition
params - 方法参数列表/Method parameter list
interceptorChain - 拦截器链
- 返回:
- 返回拦截的方法的返回值,可以对该值进行处理和替换/Returns the return value of the intercepting method, which can be processed and replaced.
- 抛出:
Throwable - 该方法可能抛出异常,请谨慎处理/This method may throw an exception, handle with care.