Class AnnotationMatchingPointcut
- java.lang.Object
- org.springframework.aop.support.annotation.AnnotationMatchingPointcut
- All Implemented Interfaces:
Pointcut
public class AnnotationMatchingPointcut extends Object implements Pointcut
- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
AnnotationClassFilter,AnnotationMethodMatcher
Constructor Summary
Constructors Constructor Description AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType)Create a new AnnotationMatchingPointcut for the given annotation type.AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType, boolean checkInherited)Create a new AnnotationMatchingPointcut for the given annotation type.AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType, Class<? extends Annotation> methodAnnotationType)Create a new AnnotationMatchingPointcut for the given annotation types.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)static AnnotationMatchingPointcutforClassAnnotation(Class<? extends Annotation> annotationType)Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the class level.static AnnotationMatchingPointcutforMethodAnnotation(Class<? extends Annotation> annotationType)Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the method level.ClassFiltergetClassFilter()Return the ClassFilter for this pointcut.MethodMatchergetMethodMatcher()Return the MethodMatcher for this pointcut.inthashCode()StringtoString()
Constructor Detail
AnnotationMatchingPointcut
public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType)
Create a new AnnotationMatchingPointcut for the given annotation type.- Parameters:
classAnnotationType- the annotation type to look for at the class level
AnnotationMatchingPointcut
public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType, boolean checkInherited)
Create a new AnnotationMatchingPointcut for the given annotation type.- Parameters:
classAnnotationType- the annotation type to look for at the class levelcheckInherited- whether to also check the superclasses and interfaces as well as meta-annotations for the annotation type- See Also:
AnnotationClassFilter(Class, boolean)
AnnotationMatchingPointcut
public AnnotationMatchingPointcut(Class<? extends Annotation> classAnnotationType, Class<? extends Annotation> methodAnnotationType)
Create a new AnnotationMatchingPointcut for the given annotation types.- Parameters:
classAnnotationType- the annotation type to look for at the class level (can benull)methodAnnotationType- the annotation type to look for at the method level (can benull)
Method Detail
getClassFilter
public ClassFilter getClassFilter()
Description copied from interface:PointcutReturn the ClassFilter for this pointcut.- Specified by:
getClassFilterin interfacePointcut- Returns:
- the ClassFilter (never
null)
getMethodMatcher
public MethodMatcher getMethodMatcher()
Description copied from interface:PointcutReturn the MethodMatcher for this pointcut.- Specified by:
getMethodMatcherin interfacePointcut- Returns:
- the MethodMatcher (never
null)
forClassAnnotation
public static AnnotationMatchingPointcut forClassAnnotation(Class<? extends Annotation> annotationType)
Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the class level.- Parameters:
annotationType- the annotation type to look for at the class level- Returns:
- the corresponding AnnotationMatchingPointcut
forMethodAnnotation
public static AnnotationMatchingPointcut forMethodAnnotation(Class<? extends Annotation> annotationType)
Factory method for an AnnotationMatchingPointcut that matches for the specified annotation at the method level.- Parameters:
annotationType- the annotation type to look for at the method level- Returns:
- the corresponding AnnotationMatchingPointcut