private <A extends Annotation>A findFieldAnnotation(Class<A> annotationType,Class<?> cls,String fieldName){
  do {
    for (    Field f : cls.getDeclaredFields()) {
      if (fieldName.equals(f.getName())) {
        return f.getAnnotation(annotationType);
      }
    }
    if (cls.isInterface() || cls == Object.class) {
      break;
    }
    cls=cls.getSuperclass();
  }
 while (cls != null);
  return null;
}

private < A extends Annotation > A findFieldAnnotation ( Class < A > annotationType , Class < ? > cls , String fieldName ) { do { for ( Field f : cls . getDeclaredFields ( ) ) { if ( fieldName . equals ( f . getName ( ) ) ) { return f . getAnnotation ( annotationType ) ; } } if ( cls . isInterface ( ) || cls == Object . class ) { break ; } cls = cls . getSuperclass ( ) ; } while ( cls != null ) ; return null ; }
helper method for locating field on given class , checking if it has specified annotation , and returning it if found .
