Java Reflection Annotation getAnnotation(AnnotatedElement element, Class annotation)

Here you can find the source of getAnnotation(AnnotatedElement element, Class annotation)

Description

get Annotation

License

Open Source License

Declaration

public static Annotation getAnnotation(AnnotatedElement element, Class<? extends Annotation> annotation) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

public class Main {
    public static Annotation getAnnotation(AnnotatedElement element, Class<? extends Annotation> annotation) {
        return element.getAnnotation(annotation);
    }//from   www. ja v  a 2  s . com
}

Related

  1. getAnnotation( final Method method, final Class annotationClass)
  2. getAnnotation(@Nonnull Annotation[] annotations, @Nonnull Class annotation)
  3. getAnnotation(@Nonnull Class cls, @Nonnull Class annotation)
  4. getAnnotation(AnnotatedElement ae, Class annotationType)
  5. getAnnotation(AnnotatedElement aobj, Class aClass)
  6. getAnnotation(AnnotatedElement element, String annotationTypeName)
  7. getAnnotation(AnnotatedElement target, String annotationType)
  8. getAnnotation(Annotation ann, Class annotationType)
  9. getAnnotation(Annotation[] annotaions, Class T)