List<Field> visibleFields = new ArrayList<Field>();
addVisibleFields(fields(), fieldNames, visibleFields);
// All fields of the interfaces it implements.
Iterator<InterfaceType> interfaces = interfaces().iterator();
InterfaceType inter;
while (interfaces.hasNext()) {
inter = interfaces.next();
addVisibleFields(inter.visibleFields(), fieldNames, visibleFields);
}
// If it is a class, all fields of it's superclass.
if (this instanceof ClassType) {
ClassType superclass = ((ClassType) this).superclass();