code: List<VariableElement> getAllFields(TypeElement subclazz) {
          List<VariableElement> fields = new ArrayList<>();
          TypeElement cd = null;
          Stack<TypeElement> s = new Stack<>();
  
          cd = subclazz;
          while (true) {
              s.push(cd);
              TypeElement c = (TypeElement) (types.asElement(cd.getSuperclass()));
              if (c == null)
                  break;
              cd = c;
          }
  
          while (!s.empty()) {
              cd = s.pop();
              fields.addAll(ElementFilter.fieldsIn(cd.getEnclosedElements()));
          }
  
          return fields;
      }
docs: Including super classes' fields.