Here is some way to get annotation,
Class<?> cls = Class.forName(name); cls.getDeclaredAnnotations(); // get all annotation (cls.getDeclaredMethods()[0]).getAnnotations(); //get annotation of a method Annotation ety = cls.getAnnotation(Annotation.class); // get annotation of particular annotation class
source share