Enum Class MergedAnnotations.SearchStrategy
java.lang.Object
java.lang.Enum<MergedAnnotations.SearchStrategy>
org.springframework.core.annotation.MergedAnnotations.SearchStrategy
- All Implemented Interfaces:
Serializable, Comparable<MergedAnnotations.SearchStrategy>, Constable
- Enclosing interface:
MergedAnnotations
Search strategies supported by
MergedAnnotations.search(SearchStrategy)
as well as MergedAnnotations.from(AnnotatedElement, SearchStrategy)
and variants of that method.
Each strategy creates a different set of aggregates that will be
combined to create the final MergedAnnotations.
- Since:
- 5.2
- Author:
- Phillip Webb, Sam Brannen
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFind only directly declared annotations, without considering@Inheritedannotations and without searching superclasses or implemented interfaces.Find all directly declared annotations as well as any@Inheritedsuperclass annotations.Find all directly declared and superclass annotations.Perform a full search of the entire type hierarchy, including superclasses and implemented interfaces. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static MergedAnnotations.SearchStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DIRECT
Find only directly declared annotations, without considering@Inheritedannotations and without searching superclasses or implemented interfaces. -
INHERITED_ANNOTATIONS
Find all directly declared annotations as well as any@Inheritedsuperclass annotations.This strategy is only really useful when used with
Classtypes since the@Inheritedannotation is ignored for all other annotated elements.This strategy does not search implemented interfaces.
-
SUPERCLASS
Find all directly declared and superclass annotations.This strategy is similar to
INHERITED_ANNOTATIONSexcept the annotations do not need to be meta-annotated with@Inherited.This strategy does not search implemented interfaces.
-
TYPE_HIERARCHY
Perform a full search of the entire type hierarchy, including superclasses and implemented interfaces.When combined with
MergedAnnotations.Search.withEnclosingClasses(Predicate), enclosing classes will also be recursively searched if the suppliedPredicateevaluates totrue.Superclass and enclosing class annotations do not need to be meta-annotated with
@Inherited.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-