Package com.alibaba.fastjson2.util
Class AnnotationUtils
java.lang.Object
com.alibaba.fastjson2.util.AnnotationUtils
Annotation utils transformed from
org.junit.platform.commons.util.AnnotationUtils- Author:
- lzhpo
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation>
AfindAnnotation(Annotation annotation, Class<A> annotationType) If theannotation's annotationType is notannotationType, then to find the first annotation ofannotationTypethat is either directly present, meta-present, or indirectly present on the suppliedelement.static <A extends Annotation>
AfindAnnotation(AnnotatedElement element, Class<A> annotationType) Find the first annotation ofannotationTypethat is either directly present, meta-present, or indirectly present on the suppliedelement.static Annotation[]getAnnotations(Class objectClass) static Annotation[]getAnnotations(AccessibleObject accessibleObject) static Annotation[]getAnnotations(AnnotatedElement element) static Annotation[]getAnnotations(Parameter parameter)
-
Method Details
-
findAnnotation
public static <A extends Annotation> A findAnnotation(AnnotatedElement element, Class<A> annotationType) Find the first annotation ofannotationTypethat is either directly present, meta-present, or indirectly present on the suppliedelement.If the element is a class and the annotation is neither directly present nor meta-present on the class, this method will additionally search on interfaces implemented by the class before finding an annotation that is indirectly present on the class.
- Type Parameters:
A- the annotation- Parameters:
element- the element on which to search for the annotationannotationType- the annotation type of need to search- Returns:
- the searched annotation type
-
findAnnotation
public static <A extends Annotation> A findAnnotation(Annotation annotation, Class<A> annotationType) If theannotation's annotationType is notannotationType, then to find the first annotation ofannotationTypethat is either directly present, meta-present, or indirectly present on the suppliedelement.- Type Parameters:
A- the searched annotation type- Parameters:
annotation- annotationannotationType- the annotation type of need to search- Returns:
- the searched annotation
-
getAnnotations
-
getAnnotations
-
getAnnotations
-
getAnnotations
-