Here you can find the source of getAnnotations(final Class> clazz, final String fieldName)
public static Annotation[] getAnnotations(final Class<?> clazz, final String fieldName)
//package com.java2s; //License from project: Apache License import java.lang.annotation.Annotation; import java.lang.reflect.Field; public class Main { public static Annotation[] getAnnotations(final Class<?> clazz, final String fieldName) { try {/*from www . j a va2s. com*/ Field field = clazz.getDeclaredField(fieldName); field.setAccessible(true); return field.getAnnotations(); } catch (ReflectiveOperationException e) { throw new RuntimeException(e); } } }