Class MergedAnnotationSelectors
java.lang.Object
org.springframework.core.annotation.MergedAnnotationSelectors
MergedAnnotationSelector
implementations that provide various options
for MergedAnnotation
instances.- Since:
- 5.2
- Author:
- Phillip Webb
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation>
MergedAnnotationSelector<A>Select the first directly declared annotation when possible.static <A extends Annotation>
MergedAnnotationSelector<A>nearest()
Select the nearest annotation, i.e.
-
Method Details
-
nearest
Select the nearest annotation, i.e. the one with the lowest distance.- Returns:
- a selector that picks the annotation with the lowest distance
-
firstDirectlyDeclared
Select the first directly declared annotation when possible. If no direct annotations are declared then the nearest annotation is selected.- Returns:
- a selector that picks the first directly declared annotation whenever possible
-