@Nullable open static fun <A : Annotation> getMergedAnnotation(element: AnnotatedElement, annotationType: Class<A>): A
Get the first annotation of the specified annotationType within the annotation hierarchy above the supplied element, merge that annotation's attributes with matching attributes from annotations in lower levels of the annotation hierarchy, and synthesize the result back into an annotation of the specified annotationType.
AliasFor semantics are fully supported, both within a single annotation and within the annotation hierarchy.
This method delegates to #getMergedAnnotationAttributes(AnnotatedElement, Class) and AnnotationUtils#synthesizeAnnotation(Map, Class, AnnotatedElement).
element - the annotated element
annotationType - the annotation type to find
Return
the merged, synthesized Annotation, or null if not found
Since
4.2
See Also
#getMergedAnnotationAttributes(AnnotatedElement, Class)#findMergedAnnotation(AnnotatedElement, Class)AnnotationUtils#synthesizeAnnotation(Map, Class, AnnotatedElement)