在使用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); }
AspectJ获取方法注解的信息,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/rollenholt/p/3848405.html