public class TypeAnnotationScanner extends AbstractTypeAnnotationScanner<TypeAnnotationScanner> implements AnnotationScanner
Class上的注解| 限定符和类型 | 类和说明 |
|---|---|
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| 构造器和说明 |
|---|
TypeAnnotationScanner()
构建一个类注解扫描器,默认允许扫描指定元素的父类以及父接口
|
TypeAnnotationScanner(boolean includeSupperClass,
boolean includeInterfaces,
Predicate<Class<?>> filter,
Set<Class<?>> excludeTypes)
构造一个类注解扫描器
|
| 限定符和类型 | 方法和说明 |
|---|---|
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, setFilterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAnnotations, getAnnotationsIfSupport, scan, scanByAllSupported, scanByAnySupported, scanIfSupportpublic TypeAnnotationScanner(boolean includeSupperClass,
boolean includeInterfaces,
Predicate<Class<?>> filter,
Set<Class<?>> excludeTypes)
includeSupperClass - 是否允许扫描父类includeInterfaces - 是否允许扫描父接口filter - 过滤器excludeTypes - 不包含的类型public TypeAnnotationScanner()
public boolean support(AnnotatedElement annotatedEle)
Class接时返回truesupport 在接口中 AnnotationScannerannotatedEle - AnnotatedElement,可以是Class、Method、Field、Constructor、ReflectPermissionprotected Class<?> getClassFormAnnotatedElement(AnnotatedElement annotatedEle)
ClassgetClassFormAnnotatedElement 在类中 AbstractTypeAnnotationScanner<TypeAnnotationScanner>annotatedEle - AnnotatedElement,可以是Class、Method、Field、Constructor、ReflectPermissionprotected Annotation[] getAnnotationsFromTargetClass(AnnotatedElement source, int index, Class<?> targetClass)
getAnnotationsFromTargetClass 在类中 AbstractTypeAnnotationScanner<TypeAnnotationScanner>source - 最初的注解元素index - 类的层级索引targetClass - 类public TypeAnnotationScanner setIncludeSuperClass(boolean includeSuperClass)
setIncludeSuperClass 在类中 AbstractTypeAnnotationScanner<TypeAnnotationScanner>includeSuperClass - 是否允许扫描父类public TypeAnnotationScanner setIncludeInterfaces(boolean includeInterfaces)
setIncludeInterfaces 在类中 AbstractTypeAnnotationScanner<TypeAnnotationScanner>includeInterfaces - 是否允许扫描父类Copyright © 2022. All rights reserved.