use of com.google.devtools.j2objc.ast.AnnotationTypeMemberDeclaration in project j2objc by google.
the class TreeConverter method convertAnnotationTypeDeclaration.
private TreeNode convertAnnotationTypeDeclaration(JCTree.JCClassDecl node) {
AnnotationTypeDeclaration newNode = new AnnotationTypeDeclaration();
convertBodyDeclaration(node, node.getModifiers(), newNode, node.sym);
for (JCTree bodyDecl : node.getMembers()) {
if (bodyDecl.getKind() == Kind.METHOD) {
JCTree.JCMethodDecl methodDecl = (JCTree.JCMethodDecl) bodyDecl;
AnnotationTypeMemberDeclaration newMember = new AnnotationTypeMemberDeclaration().setDefault((Expression) convert(methodDecl.defaultValue)).setExecutableElement(methodDecl.sym);
newMember.setModifiers((int) methodDecl.getModifiers().flags).setAnnotations(convertAnnotations(methodDecl.mods)).setJavadoc((Javadoc) getAssociatedJavaDoc(methodDecl, methodDecl.sym));
newNode.addBodyDeclaration(newMember);
} else {
newNode.addBodyDeclaration((BodyDeclaration) convert(bodyDecl));
}
}
return newNode.setName(convertSimpleName(node.sym, node.type, getNamePosition(node))).setTypeElement(node.sym);
}
Aggregations