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 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 class
      annotationClass - class we search for an annotatation
      Returns:
      an annotation, or null if none is found