Class MergedAnnotationSelectors

java.lang.Object
org.springframework.core.annotation.MergedAnnotationSelectors

public abstract class MergedAnnotationSelectors extends Object
MergedAnnotationSelector implementations that provide various options for MergedAnnotation instances.
Since:
5.2
Author:
Phillip Webb
See Also:
  • Method Details

    • nearest

      public static <A extends Annotation> MergedAnnotationSelector<A> 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

      public static <A extends Annotation> MergedAnnotationSelector<A> 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