@Override
 public void visit(final EnumConstantDeclaration n, final A arg) {
   visitComment(n.getComment(), arg);
   visitAnnotations(n, 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);
     }
   }
 }
 @Override
 public void visit(final EnumDeclaration n, final A arg) {
   visitComment(n.getComment(), arg);
   visitAnnotations(n, arg);
   n.getNameExpr().accept(this, arg);
   if (n.getImplements() != null) {
     for (final ClassOrInterfaceType c : n.getImplements()) {
       c.accept(this, arg);
     }
   }
   if (n.getEntries() != null) {
     for (final EnumConstantDeclaration e : n.getEntries()) {
       e.accept(this, arg);
     }
   }
   if (n.getMembers() != null) {
     for (final BodyDeclaration<?> member : n.getMembers()) {
       member.accept(this, arg);
     }
   }
 }
Exemplo n.º 3
0
  @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;
  }