在使用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);
}

  

05-08 15:28