Enum Class MergedAnnotations.SearchStrategy
- All Implemented Interfaces:
Serializable,Comparable<MergedAnnotations.SearchStrategy>,Constable
- Enclosing interface:
- MergedAnnotations
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<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.Deprecated.as of Spring Framework 6.0 M3, for potential removal or replacement before 6.0 GA -
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.Superclass annotations do not need to be meta-annotated with
@Inherited. -
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES
@Deprecated public static final MergedAnnotations.SearchStrategy TYPE_HIERARCHY_AND_ENCLOSING_CLASSESDeprecated.as of Spring Framework 6.0 M3, for potential removal or replacement before 6.0 GAPerform a full search of the entire type hierarchy on the source and any enclosing classes.This strategy is similar to
TYPE_HIERARCHYexcept that enclosing classes are also searched.Superclass and enclosing class annotations do not need to be meta-annotated with
@Inherited.When searching a
Methodsource, this strategy is identical toTYPE_HIERARCHY.WARNING: This strategy searches recursively for annotations on the enclosing class for any source type, regardless whether the source type is an inner class, a
staticnested class, or a nested interface. Thus, it may find more annotations than you would expect.
-
-
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
-