获取切入点信息

以前置增强为例
JoinPoint

//调用目标方法前调用-前置增强

    public  void begins(JoinPoint joinPoint){
        System.out.println("方法开始执行........");
        System.out.println("切入方法:"+joinPoint.getSignature());//Signature 签名
        System.out.println("切入对象:"+joinPoint.getTarget().getClass());//Target 目标
        Object[] args= joinPoint.getArgs();
        for (Object arg : args) {
            System.out.println("切入点参数:"+arg);
        }
    }

猜你喜欢

转载自blog.csdn.net/fdk2zhang/article/details/82988195