Java tutorial
//package com.java2s; //License from project: Apache License import java.lang.annotation.Annotation; public class Main { public static boolean hasAnnotation(Class clas, Class annotationClass) { boolean has = false; Annotation a = clas.getAnnotation(annotationClass); return a == null ? false : true; } }