类 AnnotationMethodMatcher
- java.lang.Object
- org.springframework.aop.support.StaticMethodMatcher
- org.springframework.aop.support.annotation.AnnotationMethodMatcher
- 所有已实现的接口:
MethodMatcher
public class AnnotationMethodMatcher extends StaticMethodMatcher
Simple MethodMatcher that looks for a specific Java 5 annotation being present on a method (checking both the method on the invoked interface, if any, and the corresponding method on the target class).- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller, Sam Brannen
- 另请参阅:
AnnotationMatchingPointcut
字段概要
从接口继承的字段 org.springframework.aop.MethodMatcher
TRUE
构造器概要
构造器 构造器 说明 AnnotationMethodMatcher(Class<? extends Annotation> annotationType)
Create a new AnnotationClassFilter for the given annotation type.AnnotationMethodMatcher(Class<? extends Annotation> annotationType, boolean checkInherited)
Create a new AnnotationClassFilter for the given annotation type.
构造器详细资料
AnnotationMethodMatcher
public AnnotationMethodMatcher(Class<? extends Annotation> annotationType)
Create a new AnnotationClassFilter for the given annotation type.- 参数:
annotationType
- the annotation type to look for
AnnotationMethodMatcher
public AnnotationMethodMatcher(Class<? extends Annotation> annotationType, boolean checkInherited)
Create a new AnnotationClassFilter for the given annotation type.- 参数:
annotationType
- the annotation type to look forcheckInherited
- whether to also check the superclasses and interfaces as well as meta-annotations for the annotation type (i.e. whether to useAnnotatedElementUtils.hasAnnotation(java.lang.reflect.AnnotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>)
semantics instead of standard JavaAccessibleObject.isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>)
)- 从以下版本开始:
- 5.0
方法详细资料
matches
public boolean matches(Method method, Class<?> targetClass)
从接口复制的说明:MethodMatcher
Perform static checking whether the given method matches.If this returns
false
or if theMethodMatcher.isRuntime()
method returnsfalse
, no runtime check (i.e. noMethodMatcher.matches(java.lang.reflect.Method, Class, Object[])
call) will be made.- 参数:
method
- the candidate methodtargetClass
- the target class- 返回:
- whether or not this method matches statically