类 AnnotationTypeMappings
java.lang.Object
cn.taketoday.core.annotation.AnnotationTypeMappings
- 所有已实现的接口:
Iterable<AnnotationTypeMapping>
Provides
AnnotationTypeMapping information for a single source
annotation type. Performs a recursive breadth first crawl of all
meta-annotations to ultimately provide a quick way to map the attributes of
a root Annotation.
Supports convention based merging of meta-annotations as well as implicit
and explicit @AliasFor aliases. Also provides information
about mirrored attributes.
This class is designed to be cached so that meta-annotations only need to be searched once, regardless of how many times they are actually used.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private static final IntrospectionFailureLoggerprivate final AnnotationFilterprivate final ArrayList<AnnotationTypeMapping>private static final ConcurrentReferenceHashMap<AnnotationFilter,AnnotationTypeMappings.Cache> private final RepeatableContainersprivate static final ConcurrentReferenceHashMap<AnnotationFilter,AnnotationTypeMappings.Cache> -
构造器概要
构造器限定符构造器说明privateAnnotationTypeMappings(RepeatableContainers repeatableContainers, AnnotationFilter filter, Class<? extends Annotation> annotationType, Set<Class<? extends Annotation>> visitedAnnotationTypes) -
方法概要
修饰符和类型方法说明private voidaddAllMappings(Class<? extends Annotation> annotationType, Set<Class<? extends Annotation>> visitedAnnotationTypes) private voidaddIfPossible(Deque<AnnotationTypeMapping> queue, AnnotationTypeMapping source, Annotation ann) private voidaddIfPossible(Deque<AnnotationTypeMapping> queue, AnnotationTypeMapping source, Class<? extends Annotation> annotationType, Annotation ann, Set<Class<? extends Annotation>> visitedAnnotationTypes) private voidaddMetaAnnotationsToQueue(Deque<AnnotationTypeMapping> queue, AnnotationTypeMapping source) (专用程序包) static void(专用程序包) static AnnotationTypeMappingsforAnnotationType(Class<? extends Annotation> annotationType) CreateAnnotationTypeMappingsfor the specified annotation type.(专用程序包) static AnnotationTypeMappingsforAnnotationType(Class<? extends Annotation> annotationType, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter) CreateAnnotationTypeMappingsfor the specified annotation type.private static AnnotationTypeMappingsforAnnotationType(Class<? extends Annotation> annotationType, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter, Set<Class<? extends Annotation>> visitedAnnotationTypes) CreateAnnotationTypeMappingsfor the specified annotation type.(专用程序包) static AnnotationTypeMappingsforAnnotationType(Class<? extends Annotation> annotationType, Set<Class<? extends Annotation>> visitedAnnotationTypes) CreateAnnotationTypeMappingsfor the specified annotation type.voidforEach(Consumer<? super AnnotationTypeMapping> action) (专用程序包) AnnotationTypeMappingget(int index) Get an individual mapping from this instance.private booleanisAlreadyMapped(AnnotationTypeMapping source, Annotation metaAnnotation) private booleanisNotMappable(AnnotationTypeMapping source, Annotation metaAnnotation) iterator()(专用程序包) intsize()Get the total number of contained mappings.
-
字段详细资料
-
failureLogger
-
standardRepeatablesCache
private static final ConcurrentReferenceHashMap<AnnotationFilter,AnnotationTypeMappings.Cache> standardRepeatablesCache -
noRepeatablesCache
private static final ConcurrentReferenceHashMap<AnnotationFilter,AnnotationTypeMappings.Cache> noRepeatablesCache -
filter
-
mappings
-
repeatableContainers
-
-
构造器详细资料
-
AnnotationTypeMappings
private AnnotationTypeMappings(RepeatableContainers repeatableContainers, AnnotationFilter filter, Class<? extends Annotation> annotationType, Set<Class<? extends Annotation>> visitedAnnotationTypes)
-
-
方法详细资料
-
addAllMappings
private void addAllMappings(Class<? extends Annotation> annotationType, Set<Class<? extends Annotation>> visitedAnnotationTypes) -
addMetaAnnotationsToQueue
private void addMetaAnnotationsToQueue(Deque<AnnotationTypeMapping> queue, AnnotationTypeMapping source) -
addIfPossible
private void addIfPossible(Deque<AnnotationTypeMapping> queue, AnnotationTypeMapping source, Annotation ann) -
addIfPossible
private void addIfPossible(Deque<AnnotationTypeMapping> queue, @Nullable AnnotationTypeMapping source, Class<? extends Annotation> annotationType, @Nullable Annotation ann, Set<Class<? extends Annotation>> visitedAnnotationTypes) -
isNotMappable
-
isAlreadyMapped
-
size
int size()Get the total number of contained mappings.- 返回:
- the total number of mappings
-
get
Get an individual mapping from this instance.Index
0will always return the root mapping; higher indexes will return meta-annotation mappings.- 参数:
index- the index to return- 返回:
- the
AnnotationTypeMapping - 抛出:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= size())
-
iterator
- 指定者:
iterator在接口中Iterable<AnnotationTypeMapping>
-
forEach
- 指定者:
forEach在接口中Iterable<AnnotationTypeMapping>
-
spliterator
- 指定者:
spliterator在接口中Iterable<AnnotationTypeMapping>
-
forAnnotationType
CreateAnnotationTypeMappingsfor the specified annotation type.- 参数:
annotationType- the source annotation type- 返回:
- type mappings for the annotation type
-
forAnnotationType
static AnnotationTypeMappings forAnnotationType(Class<? extends Annotation> annotationType, Set<Class<? extends Annotation>> visitedAnnotationTypes) CreateAnnotationTypeMappingsfor the specified annotation type.- 参数:
annotationType- the source annotation typevisitedAnnotationTypes- the set of annotations that we have already visited; used to avoid infinite recursion for recursive annotations which some JVM languages support (such as Kotlin)- 返回:
- type mappings for the annotation type
-
forAnnotationType
static AnnotationTypeMappings forAnnotationType(Class<? extends Annotation> annotationType, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter) CreateAnnotationTypeMappingsfor the specified annotation type.- 参数:
annotationType- the source annotation typerepeatableContainers- the repeatable containers that may be used by the meta-annotationsannotationFilter- the annotation filter used to limit which annotations are considered- 返回:
- type mappings for the annotation type
-
forAnnotationType
private static AnnotationTypeMappings forAnnotationType(Class<? extends Annotation> annotationType, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter, Set<Class<? extends Annotation>> visitedAnnotationTypes) CreateAnnotationTypeMappingsfor the specified annotation type.- 参数:
annotationType- the source annotation typerepeatableContainers- the repeatable containers that may be used by the meta-annotationsannotationFilter- the annotation filter used to limit which annotations are consideredvisitedAnnotationTypes- the set of annotations that we have already visited; used to avoid infinite recursion for recursive annotations which some JVM languages support (such as Kotlin)- 返回:
- type mappings for the annotation type
-
clearCache
static void clearCache()
-