public static void collectAllInheritedTypes(ITypeBinding type, Set<ITypeBinding> inheritedTypes) { collectAllInterfaces(type, inheritedTypes); while (true) { type = type.getSuperclass(); if (type == null) { break; } inheritedTypes.add(type); } }
/** * Returns a set containing bindings of all interfaces implemented by the given class, and all * super-interfaces of those. */ public static Set<ITypeBinding> getAllInterfaces(ITypeBinding type) { Set<ITypeBinding> interfaces = Sets.newHashSet(); collectAllInterfaces(type, interfaces); return interfaces; }