use of com.google.devtools.j2objc.ast.EnumDeclaration in project j2objc by google.
the class TranslationUtil method getInterfaceTypes.
public static List<TypeElement> getInterfaceTypes(AbstractTypeDeclaration node) {
// Use the AST as the source of truth where possible.
List<? extends TypeMirror> astInterfaces = null;
if (node instanceof TypeDeclaration) {
astInterfaces = ((TypeDeclaration) node).getSuperInterfaceTypeMirrors();
} else if (node instanceof EnumDeclaration) {
astInterfaces = ((EnumDeclaration) node).getSuperInterfaceTypeMirrors();
} else {
// AnnotationTypeDeclaration
return ElementUtil.getInterfaces(node.getTypeElement());
}
List<TypeElement> result = new ArrayList<>();
for (TypeMirror typeMirror : astInterfaces) {
result.add(TypeUtil.asTypeElement(typeMirror));
}
return result;
}
Aggregations