在使用Aspectj获取方法注解信息的时候,可以使用下面的代码片段:

    /**
     * Get value of annotated method parameter
     */
    private <T extends Annotation> T getMethodAnnotation(ProceedingJoinPoint joinPoint, Class<T> clazz) {
        MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
        Method method = methodSignature.getMethod();
        return method.getAnnotation(clazz);
    }

  

相关文章:

  • 2022-12-23
  • 2021-09-21
  • 2021-05-22
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-08-08
  • 2021-10-03
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案