Package com.norconex.commons.lang
Class ClassUtil
- java.lang.Object
-
- com.norconex.commons.lang.ClassUtil
-
public final class ClassUtil extends Object
Class-related utility methods.- Since:
- 2.0.0
- Author:
- Pascal Essiembre
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A extends Annotation>
AgetAnnotation(Class<?> annotatedClass, Class<A> annotationClass)Gets a type annotation, considering super classes.
-
-
-
Method Detail
-
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
-
-