Java Reflection Annotation getAnnotation(Class c, Class annotationClass)

Here you can find the source of getAnnotation(Class c, Class annotationClass)

Description

Returns true if specified class is annotated with annotation of annotationClass type.

License

Open Source License

Declaration

public static Annotation getAnnotation(Class<?> c, Class<? extends Annotation> annotationClass) 

Method Source Code


//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);
    }
}

Related

  1. getAnnotation(Class cls, Class annotationCls)
  2. getAnnotation(Class theExaminedClass, Class theExpectedAnnotation)
  3. getAnnotation(Class anno, Class cl)
  4. getAnnotation(Class annotationClass, Annotation[] annotations)
  5. getAnnotation(Class base, Class annotationClass)
  6. getAnnotation(Class classForAnnotation, Class annotationClass)
  7. getAnnotation(Class clazz, Class annotationClass)
  8. getAnnotation(Class clazz, Class annotationClass)
  9. getAnnotation(Class clazz, Class annotClass, boolean forceInherit)