Here you can find the source of findAnnotationSuperClasses(Class> annotationClass, Class c)
public static Annotation findAnnotationSuperClasses(Class<?> annotationClass, Class c)
//package com.java2s; //License from project: Apache License import java.lang.annotation.Annotation; public class Main { public static Annotation findAnnotationSuperClasses(Class<?> annotationClass, Class c) { while (c != null) { Annotation result = c.getAnnotation(annotationClass); if (result != null) return result; else//from w w w.j a v a 2s . c o m c = c.getSuperclass(); } return null; } }