public class TypeAnnotationScanner extends Object implements AnnotationScanner
Class上的注解| 限定符和类型 | 类和说明 |
|---|---|
static class |
TypeAnnotationScanner.JdkProxyClassConverter
若类型为jdk代理类,则尝试转换为原始被代理类
|
| 构造器和说明 |
|---|
TypeAnnotationScanner()
构建一个类注解扫描器,默认允许扫描指定元素的父类以及父接口
|
TypeAnnotationScanner(boolean includeSupperClass,
boolean includeInterfaces,
Predicate<Class<?>> filter,
Set<Class<?>> excludeTypes)
构造一个类注解扫描器
|
| 限定符和类型 | 方法和说明 |
|---|---|
TypeAnnotationScanner |
addConverters(UnaryOperator<Class<?>> converter)
添加转换器
|
TypeAnnotationScanner |
addExcludeTypes(Class<?>... excludeTypes)
添加不扫描的类型,该类型及其树结构将直接不被查找
|
List<Annotation> |
getAnnotations(AnnotatedElement annotatedElement)
获取可注解元素上的全部注解。
|
boolean |
isIncludeInterfaces()
是否允许扫描父接口
|
boolean |
isIncludeSupperClass()
是否允许扫描父类
|
TypeAnnotationScanner |
setFilter(Predicate<Class<?>> filter)
设置过滤器,若类型无法通过该过滤器,则该类型及其树结构将直接不被查找
|
TypeAnnotationScanner |
setIncludeInterfaces(boolean includeInterfaces)
是否允许扫描父接口
|
TypeAnnotationScanner |
setIncludeSupperClass(boolean includeSupperClass)
是否允许扫描父类
|
boolean |
support(AnnotatedElement annotatedElement)
是否支持扫描该可注解元素
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIfSupport, scanByAllScanner, scanByAnySupportedpublic TypeAnnotationScanner(boolean includeSupperClass,
boolean includeInterfaces,
Predicate<Class<?>> filter,
Set<Class<?>> excludeTypes)
includeSupperClass - 是否允许扫描父类includeInterfaces - 是否允许扫描父接口filter - 过滤器excludeTypes - 不包含的类型public TypeAnnotationScanner()
public boolean isIncludeSupperClass()
public boolean isIncludeInterfaces()
public TypeAnnotationScanner setFilter(Predicate<Class<?>> filter)
filter - 过滤器public TypeAnnotationScanner addExcludeTypes(Class<?>... excludeTypes)
excludeTypes - 不扫描的类型public TypeAnnotationScanner addConverters(UnaryOperator<Class<?>> converter)
converter - 转换器TypeAnnotationScanner.JdkProxyClassConverterpublic TypeAnnotationScanner setIncludeSupperClass(boolean includeSupperClass)
includeSupperClass - 是否public TypeAnnotationScanner setIncludeInterfaces(boolean includeInterfaces)
includeInterfaces - 是否public boolean support(AnnotatedElement annotatedElement)
AnnotationScannersupport 在接口中 AnnotationScannerannotatedElement - 可注解元素public List<Annotation> getAnnotations(AnnotatedElement annotatedElement)
AnnotationScannerAnnotationScanner.support(AnnotatedElement)返回为truegetAnnotations 在接口中 AnnotationScannerannotatedElement - 可注解元素Copyright © 2022. All rights reserved.