Class AnnotationReader


  • public class AnnotationReader
    extends Object
    Class responsible for reading annotations.
    Author:
    Tim Neumann
    • Method Detail

      • getAllMethodsWithAnnotationRecursively

        public static List<Method> getAllMethodsWithAnnotationRecursively​(Class<?> cls,
                                                                          Class<? extends Annotation> annotation)
        Get all methods with the given annotation in the given class and all parent classes.
        Parameters:
        cls - The class to get the methods from
        annotation - The type of annotation all returned methods need to have.
        Returns:
        A list of methods with the given annotation.
      • getAllAttributesWithAnnotationRecursively

        public static List<Field> getAllAttributesWithAnnotationRecursively​(Class<?> cls,
                                                                            Class<? extends Annotation> annotation)
        Get all attributes with the given annotation in the given class and all parent classes.
        Parameters:
        cls - The class to get the attributes from
        annotation - The type of annotation all returned attributes need to have.
        Returns:
        A list of attributes with the given annotation.