Class AnnotationUtils

java.lang.Object
ch.systemsx.cisd.common.reflection.AnnotationUtils

public final class AnnotationUtils extends Object
General utility methods for working with annotations.
  • Method Details

    • getAnnotatedMethodList

      public static final List<Method> getAnnotatedMethodList(Class<?> clazz, Class<? extends Annotation> annotationClass)
      For given Class returns a list of methods that are annotated with given annotationClass.
    • getAnnotatedFieldList

      public static final List<Field> getAnnotatedFieldList(Class<?> clazz, Class<? extends Annotation> annotationClass)
      For given Class returns a list of fields that are annotated with given annotationClass.
    • tryGetAnnotation

      public static final <A extends Annotation> A tryGetAnnotation(Annotation[] annotations, Class<A> annotationType)
      From the list of given annotations tries to return the one of given type.
      Returns:
      null if not found.
    • getAnnotatedParameters

      public static final <A extends Annotation> List<AnnotationUtils.Parameter<A>> getAnnotatedParameters(Method method, Class<A> annotationType)
      Returns a list of method parameters where given annotation could be found.
      Returns:
      never null but could return an empty list.