public class TypeAnnotationScanner extends AbstractTypeAnnotationScanner<TypeAnnotationScanner> implements AnnotationScanner
Class
上的注解Modifier and Type | Class and Description |
---|---|
static class |
TypeAnnotationScanner.JdkProxyClassConverter
若类型为jdk代理类,则尝试转换为原始被代理类
|
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 |
---|
TypeAnnotationScanner()
构建一个类注解扫描器,默认允许扫描指定元素的父类以及父接口
|
TypeAnnotationScanner(boolean includeSupperClass,
boolean includeInterfaces,
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 annotatedEle)
将注解元素转为
Class |
TypeAnnotationScanner |
setIncludeInterfaces(boolean includeInterfaces)
是否允许扫描父接口
|
TypeAnnotationScanner |
setIncludeSuperClass(boolean includeSuperClass)
是否允许扫描父类
|
boolean |
support(AnnotatedElement annotatedEle)
判断是否支持扫描该注解元素,仅当注解元素是
Class 接时返回true |
addConverters, addExcludeTypes, convert, isIncludeInterfaces, isIncludeSuperClass, isNotNeedProcess, scan, scanInterfaceIfNecessary, scanSuperClassIfNecessary, setFilter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnnotations, getAnnotationsIfSupport, scan, scanByAllSupported, scanByAnySupported, scanIfSupport
public TypeAnnotationScanner(boolean includeSupperClass, boolean includeInterfaces, Predicate<Class<?>> filter, Set<Class<?>> excludeTypes)
includeSupperClass
- 是否允许扫描父类includeInterfaces
- 是否允许扫描父接口filter
- 过滤器excludeTypes
- 不包含的类型public TypeAnnotationScanner()
public boolean support(AnnotatedElement annotatedEle)
Class
接时返回true
support
in interface AnnotationScanner
annotatedEle
- AnnotatedElement
,可以是Class、Method、Field、Constructor、ReflectPermissionprotected Class<?> getClassFormAnnotatedElement(AnnotatedElement annotatedEle)
Class
getClassFormAnnotatedElement
in class AbstractTypeAnnotationScanner<TypeAnnotationScanner>
annotatedEle
- AnnotatedElement
,可以是Class、Method、Field、Constructor、ReflectPermissionprotected Annotation[] getAnnotationsFromTargetClass(AnnotatedElement source, int index, Class<?> targetClass)
getAnnotationsFromTargetClass
in class AbstractTypeAnnotationScanner<TypeAnnotationScanner>
source
- 最初的注解元素index
- 类的层级索引targetClass
- 类public TypeAnnotationScanner setIncludeSuperClass(boolean includeSuperClass)
setIncludeSuperClass
in class AbstractTypeAnnotationScanner<TypeAnnotationScanner>
includeSuperClass
- 是否允许扫描父类public TypeAnnotationScanner setIncludeInterfaces(boolean includeInterfaces)
setIncludeInterfaces
in class AbstractTypeAnnotationScanner<TypeAnnotationScanner>
includeInterfaces
- 是否允许扫描父类Copyright © 2025. All rights reserved.