code: public static Field getDeclaredFieldInHierarchy(Class<?> clazz, String fieldName) throws NoSuchFieldException {
  		
  		Field field = null;
  		for (Class<?> acls = clazz; acls != null; acls = acls.getSuperclass()) {
  			try {
  				field = acls.getDeclaredField(fieldName);
  				break;
  			} catch (NoSuchFieldException e) {
  				// ignore
  			}
  		}
  		if (field == null) {
  			throw new NoSuchFieldException("Could not find field '" + fieldName + "' in class '" + clazz.getName() + "' or its super classes");
  		}
  		
  		return field;
  	}
docs: Finds a declared field in given <tt>clazz</tt> and continues to search
  up the superclass until no more super class is present.
  
  @param clazz
  @param fieldName
  @return
  @throws NoSuchFieldException