/* * @see ASTVisitor#visit(AnnotationTypeMemberDeclaration) * @since 3.0 */ public boolean visit(AnnotationTypeMemberDeclaration node) { if (node.getJavadoc() != null) { node.getJavadoc().accept(this); } printModifiers(node.modifiers()); node.getType().accept(this); this.fBuffer.append(" "); // $NON-NLS-1$ node.getName().accept(this); this.fBuffer.append("()"); // $NON-NLS-1$ if (node.getDefault() != null) { this.fBuffer.append(" default "); // $NON-NLS-1$ node.getDefault().accept(this); } this.fBuffer.append(";"); // $NON-NLS-1$ return false; }
private void printAnnotationAccessors(List<AnnotationTypeMemberDeclaration> members) { int nPrinted = 0; for (AnnotationTypeMemberDeclaration member : members) { Expression deflt = member.getDefault(); if (deflt != null) { ITypeBinding type = Types.getTypeBinding(member.getType()); String typeString = NameTable.getSpecificObjCType(type); String propertyName = NameTable.getName(member.getName()); printf("+ (%s)%sDefault {\n", typeString, propertyName); printf(" return %s;\n", generateExpression(deflt)); println("}\n"); nPrinted++; } } if (nPrinted > 0) { newline(); } }