use of javax.lang.model.util.SimpleTypeVisitor8 in project revapi by revapi.
the class Util method fillAllSuperInterfaces.
public static void fillAllSuperInterfaces(@Nonnull Types types, @Nonnull TypeMirror type, @Nonnull List<TypeMirror> result) {
try {
List<? extends TypeMirror> superTypes = types.directSupertypes(type);
SimpleTypeVisitor8<Boolean, Void> checker = new SimpleTypeVisitor8<Boolean, Void>(false) {
@Override
public Boolean visitDeclared(DeclaredType t, Void aVoid) {
return t.asElement().getKind() == ElementKind.INTERFACE;
}
};
for (TypeMirror t : superTypes) {
if (t.accept(checker, null)) {
result.add(t);
}
fillAllSuperInterfaces(types, t, result);
}
} catch (RuntimeException e) {
LOG.debug("Failed to find all super interfaces of type '" + toHumanReadableString(type) + ". Possibly " + "missing classes?", e);
}
}
Aggregations