Here you can find the source of getMethodAnnotation(Method method, Class
public static <T extends Annotation> T getMethodAnnotation(Method method, Class<T> clazz)
//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*/ }