类 TypeMappedAnnotations
java.lang.Object
cn.taketoday.core.annotation.TypeMappedAnnotations
- 所有已实现的接口:
MergedAnnotations,Iterable<MergedAnnotation<Annotation>>
MergedAnnotations implementation that searches for and adapts
annotations and meta-annotations using AnnotationTypeMappings.- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明private static classprivate classAnnotationsProcessorthat collectsTypeMappedAnnotations.Aggregateinstances.private classSpliteratorused to consume merged annotations from the aggregates in distance fist order.private static final classAnnotationsProcessorused to detect if an annotation is directly present or meta-present.private classAnnotationsProcessorthat finds a singleMergedAnnotation.从接口继承的嵌套类/接口 cn.taketoday.core.annotation.MergedAnnotations
MergedAnnotations.Search, MergedAnnotations.SearchStrategy -
字段概要
字段修饰符和类型字段说明private List<TypeMappedAnnotations.Aggregate>private final AnnotationFilterprivate final Annotation[]private final AnnotatedElement(专用程序包) static final MergedAnnotationsShared instance that can be used when there are no annotations.private final RepeatableContainersprivate final MergedAnnotations.SearchStrategyprivate final Object -
构造器概要
构造器限定符构造器说明privateTypeMappedAnnotations(Object source, Annotation[] annotations, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter) privateTypeMappedAnnotations(AnnotatedElement element, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter) -
方法概要
修饰符和类型方法说明(专用程序包) static MergedAnnotationsfrom(Object source, Annotation[] annotations, RepeatableContainers repeatableContainers, AnnotationFilter filter) Create a newMergedAnnotationsinstance from the specified annotations.(专用程序包) static MergedAnnotationsfrom(AnnotatedElement element, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter) <A extends Annotation>
MergedAnnotation<A>Get the nearest matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.<A extends Annotation>
MergedAnnotation<A>get(Class<A> annotationType, Predicate<? super MergedAnnotation<A>> predicate) Get the nearest matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.<A extends Annotation>
MergedAnnotation<A>get(Class<A> annotationType, Predicate<? super MergedAnnotation<A>> predicate, MergedAnnotationSelector<A> selector) Get a matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.<A extends Annotation>
MergedAnnotation<A>Get the nearest matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.<A extends Annotation>
MergedAnnotation<A>get(String annotationType, Predicate<? super MergedAnnotation<A>> predicate) Get the nearest matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.<A extends Annotation>
MergedAnnotation<A>get(String annotationType, Predicate<? super MergedAnnotation<A>> predicate, MergedAnnotationSelector<A> selector) Get a matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.private List<TypeMappedAnnotations.Aggregate><A extends Annotation>
AnnotationAttributes[]getAttributes(Class<A> annotationType) <A extends Annotation>
booleanisDirectlyPresent(Class<A> annotationType) Determine if the specified annotation is directly present.booleanisDirectlyPresent(String annotationType) Determine if the specified annotation is directly present.private static booleanisMappingForType(AnnotationTypeMapping mapping, AnnotationFilter filter, Object requiredType) <A extends Annotation>
booleanDetermine if the specified annotation is either directly present or meta-present.booleanDetermine if the specified annotation is either directly present or meta-present.iterator()private <C,R> R scan(C criteria, AnnotationsProcessor<C, R> processor) private <A extends Annotation>
Spliterator<MergedAnnotation<A>>spliterator(Object annotationType) stream()Stream all annotations and meta-annotations contained in this collection.<A extends Annotation>
Stream<MergedAnnotation<A>>Stream all annotations and meta-annotations that match the specified type.<A extends Annotation>
Stream<MergedAnnotation<A>>Stream all annotations and meta-annotations that match the specified type.
-
字段详细资料
-
NONE
Shared instance that can be used when there are no annotations. -
source
-
element
-
searchStrategy
-
searchEnclosingClass
-
annotations
-
repeatableContainers
-
annotationFilter
-
aggregates
-
-
构造器详细资料
-
TypeMappedAnnotations
private TypeMappedAnnotations(@Nullable AnnotatedElement element, @Nullable MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter) -
TypeMappedAnnotations
private TypeMappedAnnotations(@Nullable Object source, @Nullable Annotation[] annotations, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter)
-
-
方法详细资料
-
isPresent
从接口复制的说明:MergedAnnotationsDetermine if the specified annotation is either directly present or meta-present.Equivalent to calling
get(annotationType).isPresent().- 指定者:
isPresent在接口中MergedAnnotations- 参数:
annotationType- the annotation type to check- 返回:
trueif the annotation is present
-
isPresent
从接口复制的说明:MergedAnnotationsDetermine if the specified annotation is either directly present or meta-present.Equivalent to calling
get(annotationType).isPresent().- 指定者:
isPresent在接口中MergedAnnotations- 参数:
annotationType- the fully qualified class name of the annotation type to check- 返回:
trueif the annotation is present
-
isDirectlyPresent
从接口复制的说明:MergedAnnotationsDetermine if the specified annotation is directly present.Equivalent to calling
get(annotationType).isDirectlyPresent().- 指定者:
isDirectlyPresent在接口中MergedAnnotations- 参数:
annotationType- the annotation type to check- 返回:
trueif the annotation is directly present
-
isDirectlyPresent
从接口复制的说明:MergedAnnotationsDetermine if the specified annotation is directly present.Equivalent to calling
get(annotationType).isDirectlyPresent().- 指定者:
isDirectlyPresent在接口中MergedAnnotations- 参数:
annotationType- the fully qualified class name of the annotation type to check- 返回:
trueif the annotation is directly present
-
get
从接口复制的说明:MergedAnnotationsGet the nearest matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.- 指定者:
get在接口中MergedAnnotations- 参数:
annotationType- the annotation type to get- 返回:
- a
MergedAnnotationinstance
-
get
public <A extends Annotation> MergedAnnotation<A> get(Class<A> annotationType, @Nullable Predicate<? super MergedAnnotation<A>> predicate) 从接口复制的说明:MergedAnnotationsGet the nearest matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.- 指定者:
get在接口中MergedAnnotations- 参数:
annotationType- the annotation type to getpredicate- a predicate that must match, ornullif only type matching is required- 返回:
- a
MergedAnnotationinstance - 另请参阅:
-
get
public <A extends Annotation> MergedAnnotation<A> get(Class<A> annotationType, @Nullable Predicate<? super MergedAnnotation<A>> predicate, @Nullable MergedAnnotationSelector<A> selector) 从接口复制的说明:MergedAnnotationsGet a matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.- 指定者:
get在接口中MergedAnnotations- 参数:
annotationType- the annotation type to getpredicate- a predicate that must match, ornullif only type matching is requiredselector- a selector used to choose the most appropriate annotation within an aggregate, ornullto select the nearest- 返回:
- a
MergedAnnotationinstance - 另请参阅:
-
get
从接口复制的说明:MergedAnnotationsGet the nearest matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.- 指定者:
get在接口中MergedAnnotations- 参数:
annotationType- the fully qualified class name of the annotation type to get- 返回:
- a
MergedAnnotationinstance
-
get
public <A extends Annotation> MergedAnnotation<A> get(String annotationType, @Nullable Predicate<? super MergedAnnotation<A>> predicate) 从接口复制的说明:MergedAnnotationsGet the nearest matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.- 指定者:
get在接口中MergedAnnotations- 参数:
annotationType- the fully qualified class name of the annotation type to getpredicate- a predicate that must match, ornullif only type matching is required- 返回:
- a
MergedAnnotationinstance - 另请参阅:
-
get
public <A extends Annotation> MergedAnnotation<A> get(String annotationType, @Nullable Predicate<? super MergedAnnotation<A>> predicate, @Nullable MergedAnnotationSelector<A> selector) 从接口复制的说明:MergedAnnotationsGet a matching annotation or meta-annotation of the specified type, orMergedAnnotation.missing()if none is present.- 指定者:
get在接口中MergedAnnotations- 参数:
annotationType- the fully qualified class name of the annotation type to getpredicate- a predicate that must match, ornullif only type matching is requiredselector- a selector used to choose the most appropriate annotation within an aggregate, ornullto select the nearest- 返回:
- a
MergedAnnotationinstance - 另请参阅:
-
stream
从接口复制的说明:MergedAnnotationsStream all annotations and meta-annotations that match the specified type. The resulting stream follows the same ordering rules asMergedAnnotations.stream().- 指定者:
stream在接口中MergedAnnotations- 参数:
annotationType- the annotation type to match- 返回:
- a stream of matching annotations
-
stream
从接口复制的说明:MergedAnnotationsStream all annotations and meta-annotations that match the specified type. The resulting stream follows the same ordering rules asMergedAnnotations.stream().- 指定者:
stream在接口中MergedAnnotations- 参数:
annotationType- the fully qualified class name of the annotation type to match- 返回:
- a stream of matching annotations
-
stream
从接口复制的说明:MergedAnnotationsStream all annotations and meta-annotations contained in this collection. The resulting stream is ordered first by the aggregate index and then by the annotation distance (with the closest annotations first). This ordering means that, for most use-cases, the most suitable annotations appear earliest in the stream.- 指定者:
stream在接口中MergedAnnotations- 返回:
- a stream of annotations
-
getAttributes
- 指定者:
getAttributes在接口中MergedAnnotations
-
iterator
- 指定者:
iterator在接口中Iterable<MergedAnnotation<Annotation>>
-
spliterator
- 指定者:
spliterator在接口中Iterable<MergedAnnotation<Annotation>>
-
spliterator
private <A extends Annotation> Spliterator<MergedAnnotation<A>> spliterator(@Nullable Object annotationType) -
getAggregates
-
scan
-
from
static MergedAnnotations from(AnnotatedElement element, MergedAnnotations.SearchStrategy searchStrategy, Predicate<Class<?>> searchEnclosingClass, RepeatableContainers repeatableContainers, AnnotationFilter annotationFilter) -
from
static MergedAnnotations from(@Nullable Object source, Annotation[] annotations, RepeatableContainers repeatableContainers, AnnotationFilter filter) 从接口复制的说明:MergedAnnotationsCreate a newMergedAnnotationsinstance from the specified annotations.- 参数:
source- the source for the annotations. This source is used only for information and logging. It does not need to actually contain the specified annotations, and it will not be searched.annotations- the annotations to includerepeatableContainers- the repeatable containers that may be used by meta-annotationsfilter- an annotation filter used to restrict the annotations considered- 返回:
- a
MergedAnnotationsinstance containing the annotations - 另请参阅:
-
isMappingForType
private static boolean isMappingForType(AnnotationTypeMapping mapping, AnnotationFilter filter, @Nullable Object requiredType)
-