Java Reflection Annotation getAnnotation(Object obj, Class annClass)

Here you can find the source of getAnnotation(Object obj, Class annClass)

Description

get Annotation

License

Open Source License

Declaration

public static Annotation getAnnotation(Object obj, Class<?> annClass) 

Method Source Code


//package com.java2s;
import java.lang.annotation.Annotation;

public class Main {
    public static Annotation getAnnotation(Object obj, Class<?> annClass) {
        return getAnnotation(obj.getClass(), annClass);
    }/*  w ww  .j a v a 2 s  . c o  m*/

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static Annotation getAnnotation(Class clazz, Class<?> annClass) {
        return clazz.getAnnotation(annClass);
    }
}

Related

  1. getAnnotation(Method method, Class annotationClass)
  2. getAnnotation(Method method, Class type)
  3. getAnnotation(Object bean, final Class annotation)
  4. getAnnotation(Object context, Class annotation)
  5. getAnnotation(Object instance, Class type)
  6. getAnnotation(Object obj, Class acl)
  7. getAnnotation(Object obj, Class annotation)
  8. getAnnotation(ProceedingJoinPoint pjp, Class annotationClass)
  9. getAnnotationAttribute(Annotation a, String attrName)