spring笔记
常见Pointcout
1.NameMatchMethodPointcut
NameMatchMethodPointcut pointcut =new NameMatchMethodPointcut();pointcut.setMappedName("matches");//或多个方法pointcut.setMappedNames(new String[]{"matches","isRuntime"});
JdkRegexpMethodPointcut pointcut=new JdkRegexpMethodPointcut();pointcut.setPattern(".*match.*");//或者pointcut.setPatterns(new String[](".*match.*",".*matches"});
@ClassLevelAnnotationpublic class GenericTargetObject{ @MethodLevelAnnotation public void method1(){....}; public void method2(){....};}
AnnotationMatchingPointcut pointcut=new AnnotationMatchingPointcut( ClassLevelAnnotation.class);
AnnotationMatchingPointcut pointcut=AnnotationMatchingPointcut.forClassAnnotation( ClassLevelAnnotation.class);
AnnotationMatchingPointcut pointcut=new AnnotationMatchingPointcut( MethodLevelAnnotation.class);
AnnotationMatchingPointcut pointcut=AnnotationMatchingPointcut.forMethodAnnotation( MethodLevelAnnotation.class);
AnnotationMatchingPointcut pointcut=new AnnotationMatchingPointcut( ClassLevelAnnotation.class,MethodLevelAnnotation.class);