RequiresPermissions使用方法

 //获得目标方法的签名对象
        Signature signature = point.getSignature();
        //将目标方法的签名对象转化为MethodSignature
        MethodSignature methodSignature= (MethodSignature) signature;
        //获得方法的注解
        Method method = methodSignature.getMethod();
        //获取注解的值(权限)
        RequiresPermissions rp = method.getDeclaredAnnotation(RequiresPermissions.class);

 

posted @ 2023-11-16 16:48  八英里  阅读(562)  评论(0编辑  收藏  举报