public class MethodAnnotationScanner extends AbstractTypeAnnotationScanner<MethodAnnotationScanner> implements AnnotationScanner
Method
上的注解AbstractTypeAnnotationScanner.JdkProxyClassConverter
DIRECTLY, DIRECTLY_AND_META_ANNOTATION, INTERFACE, INTERFACE_AND_META_ANNOTATION, NOTHING, SUPERCLASS, SUPERCLASS_AND_META_ANNOTATION, TYPE_HIERARCHY, TYPE_HIERARCHY_AND_META_ANNOTATION
Constructor and Description |
---|
MethodAnnotationScanner()
构造一个类注解扫描器,仅扫描该方法上直接声明的注解
|
MethodAnnotationScanner(boolean scanSameSignatureMethod)
构造一个类注解扫描器
|
MethodAnnotationScanner(boolean includeSuperClass,
boolean includeInterfaces,
Predicate<Class<?>> filter,
Set<Class<?>> excludeTypes)
构造一个方法注解扫描器
|
MethodAnnotationScanner(boolean scanSameSignatureMethod,
Predicate<Class<?>> filter,
Set<Class<?>> excludeTypes)
构造一个方法注解扫描器
|
Modifier and Type | Method and Description |
---|---|
protected Annotation[] |
getAnnotationsFromTargetClass(AnnotatedElement source,
int index,
Class<?> targetClass)
若父类/父接口中方法具有相同的方法签名,则返回该方法上的注解
|
protected Class<?> |
getClassFormAnnotatedElement(AnnotatedElement annotatedElement)
获取声明该方法的类
|
MethodAnnotationScanner |
setScanSameSignatureMethod(boolean scanSuperMethodIfOverride)
设置是否扫描类层级结构中具有相同方法签名的方法
|
boolean |
support(AnnotatedElement annotatedEle)
判断是否支持扫描该注解元素,仅当注解元素是
Method 时返回true |
addConverters, addExcludeTypes, convert, isIncludeInterfaces, isIncludeSuperClass, isNotNeedProcess, scan, scanInterfaceIfNecessary, scanSuperClassIfNecessary, setFilter, setIncludeInterfaces, setIncludeSuperClass
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnnotations, getAnnotationsIfSupport, scan, scanByAllSupported, scanByAnySupported, scanIfSupport
public MethodAnnotationScanner()
public MethodAnnotationScanner(boolean scanSameSignatureMethod)
scanSameSignatureMethod
- 是否扫描类层级结构中具有相同方法签名的方法public MethodAnnotationScanner(boolean scanSameSignatureMethod, Predicate<Class<?>> filter, Set<Class<?>> excludeTypes)
scanSameSignatureMethod
- 是否扫描类层级结构中具有相同方法签名的方法filter
- 过滤器excludeTypes
- 不包含的类型public MethodAnnotationScanner(boolean includeSuperClass, boolean includeInterfaces, Predicate<Class<?>> filter, Set<Class<?>> excludeTypes)
includeSuperClass
- 是否允许扫描父类中具有相同方法签名的方法includeInterfaces
- 是否允许扫描父接口中具有相同方法签名的方法filter
- 过滤器excludeTypes
- 不包含的类型public boolean support(AnnotatedElement annotatedEle)
Method
时返回true
support
in interface AnnotationScanner
annotatedEle
- AnnotatedElement
,可以是Class、Method、Field、Constructor、ReflectPermissionprotected Class<?> getClassFormAnnotatedElement(AnnotatedElement annotatedElement)
getClassFormAnnotatedElement
in class AbstractTypeAnnotationScanner<MethodAnnotationScanner>
annotatedElement
- 注解元素Method.getDeclaringClass()
protected Annotation[] getAnnotationsFromTargetClass(AnnotatedElement source, int index, Class<?> targetClass)
getAnnotationsFromTargetClass
in class AbstractTypeAnnotationScanner<MethodAnnotationScanner>
source
- 原始方法index
- 类的层级索引targetClass
- 类public MethodAnnotationScanner setScanSameSignatureMethod(boolean scanSuperMethodIfOverride)
scanSuperMethodIfOverride
- 是否扫描类层级结构中具有相同方法签名的方法Copyright © 2024. All rights reserved.