接口的使用
org.springframework.core.annotation.MergedAnnotation
使用MergedAnnotation的程序包 程序包 说明 org.springframework.beans.factory.annotation Support package for annotation-driven bean configuration.org.springframework.core.annotation Core support package for annotations, meta-annotations, and merged annotations with attribute overrides.org.springframework.beans.factory.annotation中MergedAnnotation的使用
参数类型为MergedAnnotation的org.springframework.beans.factory.annotation中的方法 修饰符和类型 方法 说明 protected boolean
AutowiredAnnotationBeanPostProcessor. determineRequiredStatus(MergedAnnotation<?> ann)
Determine if the annotated field or method requires its dependency.org.springframework.core.annotation中MergedAnnotation的使用
返回MergedAnnotation的org.springframework.core.annotation中的方法 修饰符和类型 方法 说明 MergedAnnotation<A>
MergedAnnotation. filterAttributes(Predicate<String> predicate)
Create a new view of the annotation with only attributes that match the given predicate.MergedAnnotation<A>
MergedAnnotation. filterDefaultValues()
Create a new view of the annotation with all attributes that have default values removed.static <A extends Annotation>
MergedAnnotation<A>MergedAnnotation. from(A annotation)
Create a newMergedAnnotation
instance from the specified annotation.static <A extends Annotation>
MergedAnnotation<A>MergedAnnotation. from(Object source, A annotation)
Create a newMergedAnnotation
instance from the specified annotation.<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(Class<A> annotationType)
<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(Class<A> annotationType, Predicate<? super MergedAnnotation<A>> predicate)
<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(Class<A> annotationType, Predicate<? super MergedAnnotation<A>> predicate, MergedAnnotationSelector<A> selector)
Get a matching annotation or meta-annotation of the specified type, ormissing()
if none is present.<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(String annotationType)
<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(String annotationType, Predicate<? super MergedAnnotation<A>> predicate)
<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(String annotationType, Predicate<? super MergedAnnotation<A>> predicate, MergedAnnotationSelector<A> selector)
Get a matching annotation or meta-annotation of the specified type, ormissing()
if none is present.<T extends Annotation>
MergedAnnotation<T>MergedAnnotation. getAnnotation(String attributeName, Class<T> type)
Get a required annotation attribute value from the annotation.<T extends Annotation>
MergedAnnotation<T>[]MergedAnnotation. getAnnotationArray(String attributeName, Class<T> type)
Get a required annotation array attribute value from the annotation.MergedAnnotation<?>
MergedAnnotation. getMetaSource()
Get the source of the meta-annotation, ornull
if the annotation is not meta-present.MergedAnnotation<?>
MergedAnnotation. getRoot()
Get the root annotation, i.e. thedistance
0
annotation as directly declared on the source.static <A extends Annotation>
MergedAnnotation<A>MergedAnnotation. missing()
Create aMergedAnnotation
that represents a missing annotation (i.e. one that is not present).static <A extends Annotation>
MergedAnnotation<A>MergedAnnotation. of(Class<A> annotationType)
Create a newMergedAnnotation
instance of the specified annotation type.static <A extends Annotation>
MergedAnnotation<A>MergedAnnotation. of(Class<A> annotationType, Map<String,?> attributes)
Create a newMergedAnnotation
instance of the specified annotation type with attribute values supplied by a map.static <A extends Annotation>
MergedAnnotation<A>MergedAnnotation. of(ClassLoader classLoader, Object source, Class<A> annotationType, Map<String,?> attributes)
Create a newMergedAnnotation
instance of the specified annotation type with attribute values supplied by a map.static <A extends Annotation>
MergedAnnotation<A>MergedAnnotation. of(AnnotatedElement source, Class<A> annotationType, Map<String,?> attributes)
Create a newMergedAnnotation
instance of the specified annotation type with attribute values supplied by a map.MergedAnnotation<A>
MergedAnnotationSelector. select(MergedAnnotation<A> existing, MergedAnnotation<A> candidate)
Select the annotation that should be used.MergedAnnotation<A>
MergedAnnotation. withNonMergedAttributes()
Create a new view of the annotation that exposes non-merged attribute values.返回变量类型为MergedAnnotation的类型的org.springframework.core.annotation中的方法 修饰符和类型 方法 说明 static <A extends Annotation>
Predicate<MergedAnnotation<A>>MergedAnnotationPredicates. firstRunOf(Function<? super MergedAnnotation<A>,?> valueExtractor)
Create a new stateful, single usePredicate
that matches only the first run of an extracted value.Stream<MergedAnnotation<Annotation>>
MergedAnnotations. stream()
Stream all annotations and meta-annotations contained in this collection.<A extends Annotation>
Stream<MergedAnnotation<A>>MergedAnnotations. stream(Class<A> annotationType)
Stream all annotations and meta-annotations that match the specified type.<A extends Annotation>
Stream<MergedAnnotation<A>>MergedAnnotations. stream(String annotationType)
Stream all annotations and meta-annotations that match the specified type.static <A extends Annotation>
Collector<MergedAnnotation<A>,?,Annotation[]>MergedAnnotationCollectors. toAnnotationArray()
Create a newCollector
that accumulates merged annotations to anAnnotation
array containing synthesized versions.static <R extends Annotation,A extends R>
Collector<MergedAnnotation<A>,?,R[]>MergedAnnotationCollectors. toAnnotationArray(IntFunction<R[]> generator)
Create a newCollector
that accumulates merged annotations to anAnnotation
array containing synthesized versions.static <A extends Annotation>
Collector<MergedAnnotation<A>,?,Set<A>>MergedAnnotationCollectors. toAnnotationSet()
Create a newCollector
that accumulates merged annotations to aLinkedHashSet
containing synthesized versions.static <A extends Annotation>
Collector<MergedAnnotation<A>,?,MultiValueMap<String,Object>>MergedAnnotationCollectors. toMultiValueMap(Function<MultiValueMap<String,Object>,MultiValueMap<String,Object>> finisher, MergedAnnotation.Adapt... adaptations)
Create a newCollector
that accumulates merged annotations to aMultiValueMap
with items added from each merged annotation as a map.static <A extends Annotation>
Collector<MergedAnnotation<A>,?,MultiValueMap<String,Object>>MergedAnnotationCollectors. toMultiValueMap(MergedAnnotation.Adapt... adaptations)
Create a newCollector
that accumulates merged annotations to aMultiValueMap
with items added from each merged annotation as a map.static <A extends Annotation>
Predicate<MergedAnnotation<? extends A>>MergedAnnotationPredicates. typeIn(Class<?>... types)
Create a newPredicate
that evaluates totrue
if the merged annotation type is contained in the specified array.static <A extends Annotation>
Predicate<MergedAnnotation<? extends A>>MergedAnnotationPredicates. typeIn(String... typeNames)
Create a newPredicate
that evaluates totrue
if the name of the merged annotation type is contained in the specified array.static <A extends Annotation>
Predicate<MergedAnnotation<? extends A>>MergedAnnotationPredicates. typeIn(Collection<?> types)
Create a newPredicate
that evaluates totrue
if the merged annotation type is contained in the specified collection.static <A extends Annotation,K>
Predicate<MergedAnnotation<A>>MergedAnnotationPredicates. unique(Function<? super MergedAnnotation<A>,K> keyExtractor)
Create a new stateful, single usePredicate
that matches annotations that are unique based on the extracted key.参数类型为MergedAnnotation的org.springframework.core.annotation中的方法 修饰符和类型 方法 说明 default boolean
MergedAnnotationSelector. isBestCandidate(MergedAnnotation<A> annotation)
Determine if the existing annotation is known to be the best candidate and any subsequent selections may be skipped.MergedAnnotation<A>
MergedAnnotationSelector. select(MergedAnnotation<A> existing, MergedAnnotation<A> candidate)
Select the annotation that should be used.类型变量类型为MergedAnnotation的org.springframework.core.annotation中的方法参数 修饰符和类型 方法 说明 <T extends Map<String,Object>>
TMergedAnnotation. asMap(Function<MergedAnnotation<?>,T> factory, MergedAnnotation.Adapt... adaptations)
Create a newMap
instance of the given type that contains all the annotation attributes.static <A extends Annotation>
Predicate<MergedAnnotation<A>>MergedAnnotationPredicates. firstRunOf(Function<? super MergedAnnotation<A>,?> valueExtractor)
Create a new stateful, single usePredicate
that matches only the first run of an extracted value.<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(Class<A> annotationType, Predicate<? super MergedAnnotation<A>> predicate)
<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(Class<A> annotationType, Predicate<? super MergedAnnotation<A>> predicate, MergedAnnotationSelector<A> selector)
Get a matching annotation or meta-annotation of the specified type, ormissing()
if none is present.<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(String annotationType, Predicate<? super MergedAnnotation<A>> predicate)
<A extends Annotation>
MergedAnnotation<A>MergedAnnotations. get(String annotationType, Predicate<? super MergedAnnotation<A>> predicate, MergedAnnotationSelector<A> selector)
Get a matching annotation or meta-annotation of the specified type, ormissing()
if none is present.static MergedAnnotations
MergedAnnotations. of(Collection<MergedAnnotation<?>> annotations)
Create a newMergedAnnotations
instance from the specified collection of directly present annotations.Optional<A>
MergedAnnotation. synthesize(Predicate<? super MergedAnnotation<A>> condition)
Optionally create a type-safe synthesized version of this annotation based on a condition predicate.static <A extends Annotation,K>
Predicate<MergedAnnotation<A>>MergedAnnotationPredicates. unique(Function<? super MergedAnnotation<A>,K> keyExtractor)
Create a new stateful, single usePredicate
that matches annotations that are unique based on the extracted key.