Here you can find the source of getAnnotation(Class> c, Class extends Annotation> annotationClass)
true
if specified class is annotated with annotation of annotationClass
type.
public static Annotation getAnnotation(Class<?> c, Class<? extends Annotation> annotationClass)
//package com.java2s; //License from project: Open Source License import java.lang.annotation.Annotation; public class Main { /**// w ww .ja v a2s .co m * Returns <code>true</code> if specified class is annotated with annotation of * <code>annotationClass</code> type. */ public static Annotation getAnnotation(Class<?> c, Class<? extends Annotation> annotationClass) { return c.getAnnotation(annotationClass); } }