Java Reflection Annotation getAnnotations(Field field)

Here you can find the source of getAnnotations(Field field)

Description

get Annotations

License

Open Source License

Declaration

public static Annotation[] getAnnotations(Field field) 

Method Source Code


//package com.java2s;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class Main {
    public static Annotation[] getAnnotations(Field field) {
        return field.getAnnotations();
    }//from  w  w w  . j a  va  2  s .co m

    public static Annotation[] getAnnotations(Method method) {
        return method.getAnnotations();
    }
}

Related

  1. getAnnotations(Class annotationClass, Annotation[] annotations)
  2. getAnnotations(Class c, Class annotationClass)
  3. getAnnotations(Class annotation, Collection annotations)
  4. getAnnotations(Class ann, Object o, Method m, int param)
  5. getAnnotations(Enum targetEnum, Class targetAnnotationClass)
  6. getAnnotations(final Class c, final Class annClass)
  7. getAnnotations(final Class clazz, final Class annotation)
  8. getAnnotations(final Class clazz, final String fieldName)
  9. getAnnotations(Method method)