Class ReflectionHelper


  • public class ReflectionHelper
    extends Object
    • Constructor Detail

      • ReflectionHelper

        public ReflectionHelper()
    • Method Detail

      • getLocalMethods

        public static Method[] getLocalMethods​(Class<?> clazz)
        Returns:
        An array of all locally declared methods or equivalent thereof (such as default methods on Java 8 based interfaces that the given class implements).
      • excludingMain

        public static Method[] excludingMain​(Class<?> clazz)
        Returns:
        An array of all locally declared methods or equivalent thereof (such as default methods on Java 8 based interfaces that the given class implements) but excludes the main() method alone.
      • findAnnotation

        public static <T extends Annotation> T findAnnotation​(Class<?> typedTestClass,
                                                              Class<T> annotation)
        A helper method that looks for a given annotation in the current class (or) in any of the super classes
        Type Parameters:
        T - - The annotation type
        Parameters:
        typedTestClass - - The class to search for
        annotation - - The annotation to look for
        Returns:
        - Either the annotation if found (or) null.