T - 数据源类型public class GenericAnnotationAggregator<T> extends Object implements AnnotationAggregator<T>
AnnotationAggregator的基本实现| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<Class<? extends Annotation>,Collection<HierarchicalAnnotation<Annotation>>> |
aggregatedAnnotationMap
被聚合的注解
|
protected int |
horizontalIndex
与根对象的水平距离
|
protected RepeatableMappingRegistry |
repeatableMappingRegistry
可重复注解映射关系注册表
|
protected T |
root
根对象
|
protected int |
verticalIndex
与根对象的垂直距离
|
HORIZONTAL_INDEX_START_POINT, VERTICAL_INDEX_START_POINT| 构造器和说明 |
|---|
GenericAnnotationAggregator(T root,
int verticalIndex,
int horizontalIndex)
创建一个注解
|
GenericAnnotationAggregator(T root,
int verticalIndex,
int horizontalIndex,
RepeatableMappingRegistry repeatableMappingRegistry)
创建一个注解
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
accept(int verticalIndex,
int horizontalIndex,
Annotation annotation)
向当前聚合中注册注解
|
Collection<HierarchicalAnnotation<Annotation>> |
getAllAnnotations()
获取全部注解
|
Collection<HierarchicalAnnotation<Annotation>> |
getAnnotationByVerticalIndex(int verticalIndex)
获取指定层级中的注解
|
<A extends Annotation> |
getAnnotationsByType(Class<A> annotationType)
获取指定类型的注解
|
<A extends Annotation> |
getRepeatableAnnotations(Class<A> annotationType)
获取聚合中的全部可重复注解,包括该类型的注解对象,以及被嵌套在其他容器注解中的该类型注解对象
|
boolean |
isPresent(Class<? extends Annotation> annotationType)
注解是否存在
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAnnotation, getRootgetHorizontalIndex, getVerticalIndexinterruptedprotected final T root
protected final int verticalIndex
protected final int horizontalIndex
protected final RepeatableMappingRegistry repeatableMappingRegistry
protected final Map<Class<? extends Annotation>,Collection<HierarchicalAnnotation<Annotation>>> aggregatedAnnotationMap
public GenericAnnotationAggregator(T root, int verticalIndex, int horizontalIndex)
root - 根对象verticalIndex - 垂直坐标horizontalIndex - 水平坐标public GenericAnnotationAggregator(T root, int verticalIndex, int horizontalIndex, RepeatableMappingRegistry repeatableMappingRegistry)
root - 根对象verticalIndex - 垂直坐标horizontalIndex - 水平坐标repeatableMappingRegistry - 可重复注解映射表public void accept(int verticalIndex,
int horizontalIndex,
Annotation annotation)
accept 在接口中 AnnotationProcessorverticalIndex - 垂直索引。一般表示与扫描器扫描的root相隔的层级层次。默认从1开始horizontalIndex - 水平索引,一般用于衡量两个注解对象之间被扫描到的先后顺序。默认从1开始annotation - 被扫描到的注解对象public boolean isPresent(Class<? extends Annotation> annotationType)
isPresent 在接口中 AnnotationAggregator<T>annotationType - 属性类型public Collection<HierarchicalAnnotation<Annotation>> getAllAnnotations()
getAllAnnotations 在接口中 AnnotationAggregator<T>public <A extends Annotation> Collection<HierarchicalAnnotation<A>> getAnnotationsByType(Class<A> annotationType)
getAnnotationsByType 在接口中 AnnotationAggregator<T>A - 注解类型annotationType - 注解类型public Collection<HierarchicalAnnotation<Annotation>> getAnnotationByVerticalIndex(int verticalIndex)
getAnnotationByVerticalIndex 在接口中 AnnotationAggregator<T>verticalIndex - 垂直索引public <A extends Annotation> List<A> getRepeatableAnnotations(Class<A> annotationType)
getRepeatableAnnotations 在接口中 RepeatableContainerannotationType - 注解类型IllegalArgumentException - 当repeatableMappingRegistry为空时抛出Copyright © 2022. All rights reserved.