public class AnnotationMatchingPointcut extends java.lang.Object implements Pointcut
AnnotationClassFilter
,
AnnotationMethodMatcher
Modifier and Type | Class and Description |
---|---|
private static class |
AnnotationMatchingPointcut.AnnotationCandidateClassFilter
ClassFilter that delegates to AnnotationUtils.isCandidateClass(java.lang.Class<?>, java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>>)
for filtering classes whose methods are not worth searching to begin with. |
Modifier and Type | Field and Description |
---|---|
private ClassFilter |
classFilter |
private MethodMatcher |
methodMatcher |
Constructor and Description |
---|
AnnotationMatchingPointcut(java.lang.Class<? extends java.lang.annotation.Annotation> classAnnotationType)
Create a new AnnotationMatchingPointcut for the given annotation type.
|
AnnotationMatchingPointcut(java.lang.Class<? extends java.lang.annotation.Annotation> classAnnotationType,
boolean checkInherited)
Create a new AnnotationMatchingPointcut for the given annotation type.
|
AnnotationMatchingPointcut(java.lang.Class<? extends java.lang.annotation.Annotation> classAnnotationType,
java.lang.Class<? extends java.lang.annotation.Annotation> methodAnnotationType)
Create a new AnnotationMatchingPointcut for the given annotation type.
|
AnnotationMatchingPointcut(java.lang.Class<? extends java.lang.annotation.Annotation> classAnnotationType,
java.lang.Class<? extends java.lang.annotation.Annotation> methodAnnotationType,
boolean checkInherited)
Create a new AnnotationMatchingPointcut for the given annotation type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
static AnnotationMatchingPointcut |
forClassAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Factory method for an AnnotationMatchingPointcut that matches
for the specified annotation at the class level.
|
static AnnotationMatchingPointcut |
forMethodAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Factory method for an AnnotationMatchingPointcut that matches
for the specified annotation at the method level.
|
ClassFilter |
getClassFilter()
Return the ClassFilter for this pointcut.
|
MethodMatcher |
getMethodMatcher()
Return the MethodMatcher for this pointcut.
|
int |
hashCode() |
java.lang.String |
toString() |
private final ClassFilter classFilter
private final MethodMatcher methodMatcher
public AnnotationMatchingPointcut(java.lang.Class<? extends java.lang.annotation.Annotation> classAnnotationType)
classAnnotationType
- the annotation type to look for at the class levelpublic AnnotationMatchingPointcut(java.lang.Class<? extends java.lang.annotation.Annotation> classAnnotationType, boolean checkInherited)
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 typeAnnotationClassFilter.AnnotationClassFilter(Class, boolean)
public AnnotationMatchingPointcut(@Nullable java.lang.Class<? extends java.lang.annotation.Annotation> classAnnotationType, @Nullable java.lang.Class<? extends java.lang.annotation.Annotation> methodAnnotationType)
classAnnotationType
- the annotation type to look for at the class level
(can be null
)methodAnnotationType
- the annotation type to look for at the method level
(can be null
)public AnnotationMatchingPointcut(@Nullable java.lang.Class<? extends java.lang.annotation.Annotation> classAnnotationType, @Nullable java.lang.Class<? extends java.lang.annotation.Annotation> methodAnnotationType, boolean checkInherited)
classAnnotationType
- the annotation type to look for at the class level
(can be null
)methodAnnotationType
- the annotation type to look for at the method level
(can be null
)checkInherited
- whether to also check the superclasses and interfaces
as well as meta-annotations for the annotation typeAnnotationClassFilter.AnnotationClassFilter(Class, boolean)
,
AnnotationMethodMatcher.AnnotationMethodMatcher(Class, boolean)
public ClassFilter getClassFilter()
Pointcut
getClassFilter
in interface Pointcut
null
)public MethodMatcher getMethodMatcher()
Pointcut
getMethodMatcher
in interface Pointcut
null
)public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static AnnotationMatchingPointcut forClassAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType
- the annotation type to look for at the class levelpublic static AnnotationMatchingPointcut forMethodAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType
- the annotation type to look for at the method level