<!-- Spring AOP + AspectJ by shipengzhi --><dependency><groupId>org.springframework</groupId><artifactId>spring-aop</artifactId><version>3.0.6.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-aspects</artifactId><version>3.0.6.RELEASE</version></dependency><dependency><groupId>org.aspectj</groupId><artifactId>aspectjrt</artifactId><version>1.6.11</version></dependency><dependency><groupId>org.aspectj</groupId><artifactId>aspectjweaver</artifactId><version>1.6.11</version></dependency><dependency><groupId>cglib</groupId><artifactId>cglib</artifactId><version>2.1_3</version></dependency><!-- end -->
@Standardized(type=StandardizedData.CLIPON)publicclassMain{...}@Before("execution (* org.xx.xx.xx..*.*(@org.xx.xx.xx.xx.xx.Standardized (*),..))")publicvoidstandardize(JoinPointjp)throwsThrowable{Object[]args=jp.getArgs();MethodSignaturems=(MethodSignature)jp.getSignature();Methodm=ms.getMethod();Annotation[][]parameterAnnotations=m.getParameterAnnotations();for(inti=0;i<parameterAnnotations.length;i++){Annotation[]annotations=parameterAnnotations[i];System.out.println("I am checking parameter: "+args[i]);for(Annotationannotation:annotations){System.out.println(annotation);if(annotation.annotationType()==Standardized.class){System.out.println("we have a Standardized Parameter with type = "+((Standardized)annotation).type());}}}}