code: public static Field[] getKnownInstanceFields(Class<?> type) throws SecurityException {
          List<Field> fields = new ArrayList<Field>();
          while (type != null) {
              for (Field field: type.getDeclaredFields()) {
                  if (Modifier.isStatic(field.getModifiers())) continue;
                  field.setAccessible(true);
                  fields.add(field);
              }
              type = type.getSuperclass();
          }
          return fields.toArray(new Field[fields.size()]);
      }
docs: Returns all known fields in the given class and all its super classes.
  
  @param type the class to start with
  @return an array of Field objects representing all known instance fields
  @throws SecurityException if a security manager denies access