Package com.norconex.commons.lang
Class ClassUtil
java.lang.Object
com.norconex.commons.lang.ClassUtil
Class-related utility methods.
- Since:
- 2.0.0
- Author:
- Pascal Essiembre
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation>
AgetAnnotation(Class<?> annotatedClass, Class<A> annotationClass) Gets a type annotation, considering super classes.
-
Method Details
-
getAnnotation
public static <A extends Annotation> A getAnnotation(Class<?> annotatedClass, Class<A> annotationClass) Gets a type annotation, considering super classes. If more than one class in the hierarchy has an annotation of the same type, the first one matching is returned.- Type Parameters:
A- annotation type- Parameters:
annotatedClass- annotation classannotationClass- class we search for an annotatation- Returns:
- an annotation, or
nullif none is found
-