Java Reflection Annotation getAnnotations(Method method)

Here you can find the source of getAnnotations(Method method)

Description

get Annotations

License

Apache License

Declaration

public static <A extends Annotation> A[] getAnnotations(Method method)
    

Method Source Code

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

import java.lang.annotation.Annotation;

import java.lang.reflect.*;

public class Main {
    public static <A extends Annotation> A[] getAnnotations(Method method) {
        return (A[]) method.getAnnotations();
    }//from  www.j av  a 2 s .  co m

    public static <A extends Annotation> A[] getAnnotations(Class clazz) {
        return (A[]) clazz.getAnnotations();
    }
}

Related

  1. getAnnotations(Field field)
  2. getAnnotations(final Class c, final Class annClass)
  3. getAnnotations(final Class clazz, final Class annotation)
  4. getAnnotations(final Class clazz, final String fieldName)
  5. getAnnotations(Method method)
  6. getAnnotations(Method method)
  7. getAnnotations(Method method)
  8. getAnnotations(Object instance)
  9. getAnnotations(Set fields, Set methods)