@Override public Node visit(final EnumConstantDeclaration n, final A arg) { if (n.getJavaDoc() != null) { n.setJavaDoc((JavadocComment) n.getJavaDoc().accept(this, arg)); } final List<AnnotationExpr> annotations = n.getAnnotations(); if (annotations != null) { for (int i = 0; i < annotations.size(); i++) { annotations.set(i, (AnnotationExpr) annotations.get(i).accept(this, arg)); } removeNulls(annotations); } final List<Expression> args = n.getArgs(); if (args != null) { for (int i = 0; i < args.size(); i++) { args.set(i, (Expression) args.get(i).accept(this, arg)); } removeNulls(args); } final List<BodyDeclaration> classBody = n.getClassBody(); if (classBody != null) { for (int i = 0; i < classBody.size(); i++) { classBody.set(i, (BodyDeclaration) classBody.get(i).accept(this, arg)); } removeNulls(classBody); } return n; }
@Override public Boolean visit(final EnumConstantDeclaration n1, final Node arg) { final EnumConstantDeclaration n2 = (EnumConstantDeclaration) arg; // javadoc are checked at CompilationUnit if (!objEquals(n1.getName(), n2.getName())) { return Boolean.FALSE; } if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) { return Boolean.FALSE; } if (!nodesEquals(n1.getArgs(), n2.getArgs())) { return Boolean.FALSE; } if (!nodesEquals(n1.getClassBody(), n2.getClassBody())) { return Boolean.FALSE; } return Boolean.TRUE; }
@Override public void visit(final EnumConstantDeclaration n, final A arg) { visitComment(n.getComment(), arg); if (n.getJavaDoc() != null) { n.getJavaDoc().accept(this, arg); } if (n.getAnnotations() != null) { for (final AnnotationExpr a : n.getAnnotations()) { a.accept(this, arg); } } if (n.getArgs() != null) { for (final Expression e : n.getArgs()) { e.accept(this, arg); } } if (n.getClassBody() != null) { for (final BodyDeclaration member : n.getClassBody()) { member.accept(this, arg); } } }
public void visit(EnumConstantDeclaration n, Object arg) { printJavadoc(n.getJavaDoc(), arg); printMemberAnnotations(n.getAnnotations(), arg); printer.print(n.getName()); if (n.getArgs() != null) { printArguments(n.getArgs(), arg); } if (n.getClassBody() != null) { printer.printLn(" {"); printer.indent(); printMembers(n.getClassBody(), arg); printer.unindent(); printer.printLn("}"); } }
if (n.getClassBody() != null) { for (final BodyDeclaration member : n.getClassBody()) {
@Override public void visit(final EnumConstantDeclaration n, final Object arg) { printJavaComment(n.getComment(), arg); printJavadoc(n.getJavaDoc(), arg); printMemberAnnotations(n.getAnnotations(), arg); printer.print(n.getName()); if (n.getArgs() != null) { printArguments(n.getArgs(), arg); } if (n.getClassBody() != null) { printer.printLn(" {"); printer.indent(); printMembers(n.getClassBody(), arg); printer.unindent(); printer.printLn("}"); } }
@Override public Node visit(EnumConstantDeclaration _n, Object _arg) { JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg); List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg); List<Expression> args = visit(_n.getArgs(), _arg); List<BodyDeclaration> classBody = visit(_n.getClassBody(), _arg); Comment comment = cloneNodes(_n.getComment(), _arg); EnumConstantDeclaration r = new EnumConstantDeclaration( _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), annotations, _n.getName(), args, classBody ); r.setComment(comment); return r; }