code: public static Field[] getDeclaredFieldsInHierarchy(Class<?> clazz) {
  		
  		List<Field> fields = new ArrayList<Field>();
  		for (Class<?> acls = clazz; acls != null; acls = acls.getSuperclass()) {
  			for (Field field : acls.getDeclaredFields()) {
  				fields.add(field);
  			}
  		}
  		
  		return fields.toArray(new Field[fields.size()]);
  	}
docs: Finds all declared fields in given <tt>clazz</tt> and its super classes.
  
  @param clazz
  @return