类 AopAspect
- java.lang.Object
-
- xyz.xiezc.ioc.starter.common.AopAspect
-
- 所有已实现的接口:
cn.hutool.aop.aspects.Aspect
public abstract class AopAspect extends Object implements cn.hutool.aop.aspects.Aspect
-
-
构造器概要
构造器 构造器 说明 AopAspect()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidaddMethod(Method method)新增这个切面类需要拦截的方法booleanafter(Object target, Method method, Object[] args, Object returnVal)目标方法执行后的操作 如果 target.method 抛出异常且booleanafterException(Object target, Method method, Object[] args, Throwable e)目标方法抛出异常时的操作booleanbefore(Object target, Method method, Object[] args)目标方法执行前的操作abstract booleandoAfter(Object target, Method method, Object[] args, Object returnVal)abstract booleandoAfterException(Object target, Method method, Object[] args, Throwable e)abstract booleandoBefore(Object target, Method method, Object[] args)
-
-
-
方法详细资料
-
addMethod
public void addMethod(Method method)
新增这个切面类需要拦截的方法
-
before
public boolean before(Object target, Method method, Object[] args)
目标方法执行前的操作- 指定者:
before在接口中cn.hutool.aop.aspects.Aspect- 参数:
target- 目标对象method- 目标方法args- 参数- 返回:
- 是否继续执行接下来的操作
-
after
public boolean after(Object target, Method method, Object[] args, Object returnVal)
目标方法执行后的操作 如果 target.method 抛出异常且- 指定者:
after在接口中cn.hutool.aop.aspects.Aspect- 参数:
target- 目标对象method- 目标方法args- 参数returnVal- 目标方法执行返回值- 返回:
- 是否允许返回值(接下来的操作)
- 另请参阅:
返回true,则不会执行此操作 如果,返回false,则无论target.method是否抛出异常,均会执行此操作
-
doAfter
public abstract boolean doAfter(Object target, Method method, Object[] args, Object returnVal)
-
afterException
public boolean afterException(Object target, Method method, Object[] args, Throwable e)
目标方法抛出异常时的操作- 指定者:
afterException在接口中cn.hutool.aop.aspects.Aspect- 参数:
target- 目标对象method- 目标方法args- 参数e- 异常- 返回:
- 是否允许抛出异常
-
-