Class AnnotatedElementAdapter
java.lang.Object
org.springframework.core.annotation.AnnotatedElementAdapter
- All Implemented Interfaces:
Serializable, AnnotatedElement
Adapter for exposing a set of annotations as an
AnnotatedElement, in
particular as input for various methods in AnnotatedElementUtils.- Since:
- 7.0
- Author:
- Juergen Hoeller, Sam Brannen
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic AnnotatedElementAdapterfrom(Annotation @Nullable [] annotations) Create anAnnotatedElementAdapterfrom the supplied annotations.<A extends Annotation>
@Nullable AgetAnnotation(Class<A> annotationClass) <A extends Annotation>
@Nullable AgetDeclaredAnnotation(Class<A> annotationClass) inthashCode()booleanisAnnotationPresent(Class<? extends Annotation> annotationClass) booleanisEmpty()Determine if thisAnnotatedElementAdapteris empty.toString()Methods inherited from interface AnnotatedElement
getAnnotationsByType, getDeclaredAnnotationsByType
-
Method Details
-
from
Create anAnnotatedElementAdapterfrom the supplied annotations.The supplied annotations will be considered to be both present and directly present with regard to the results returned from methods such as
getAnnotation(Class),getDeclaredAnnotation(Class), etc.If the supplied annotations array is either
nullor empty, this factory method will return an empty adapter.- Parameters:
annotations- the annotations to expose via theAnnotatedElementAPI- Returns:
- a new
AnnotatedElementAdapter
-
isAnnotationPresent
- Specified by:
isAnnotationPresentin interfaceAnnotatedElement
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedElement
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatedElement
-
getDeclaredAnnotation
- Specified by:
getDeclaredAnnotationin interfaceAnnotatedElement
-
getDeclaredAnnotations
- Specified by:
getDeclaredAnnotationsin interfaceAnnotatedElement
-
isEmpty
public boolean isEmpty()Determine if thisAnnotatedElementAdapteris empty.- Returns:
trueif this adapter contains no annotations
-
equals
-
hashCode
-
toString
-