code: public static List<Field> findFields(Class<?> type,
  			Class<? extends Annotation> annotation) {
  		List<Field> list = new ArrayList<Field>();
  		while (type != null) {
  			for (Field field : type.getDeclaredFields()) {
  				if (field.getAnnotation(annotation) != null) {
  					list.add(field);
  				}
  			}
  			type = type.getSuperclass();
  		}
  		return list;
  	}
docs: Find the fields in a class (and its ancestors) annotated with a given
  annotation.
  
  @param type
  the class
  @param annotation
  the annotation
  @return the list of fields. Empty list if none is found.