Java Reflection Method Annotation getMethodAnnotation(Method method, Class clazz)

Here you can find the source of getMethodAnnotation(Method method, Class clazz)

Description

get Method Annotation

License

Apache License

Declaration

public static <T extends Annotation> T getMethodAnnotation(Method method, Class<T> clazz) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {

    public static <T extends Annotation> T getMethodAnnotation(Method method, Class<T> clazz) {
        T t = method.getAnnotation(clazz);
        return t;
    }/*from  w w w .j  av  a 2 s .  c  om*/
}

Related

  1. getMethodAnnotation(Class a, Method m)
  2. getMethodAnnotation(final Method method, final Class annoClass)
  3. getMethodAnnotation(final Method method, final Class annotationType)
  4. getMethodAnnotation(Method method, Class annotation)
  5. getMethodAnnotation(Method method, Class annotationType)
  6. getMethodAnnotationMap(Method method, Collection> annotationClasses)
  7. getMethodAnnotations(Method m)
  8. getMethodByAnnotation(Class cls, Class annotationClass)
  9. getMethodContainsAnnotations(Class target, Class annotation)