@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);
     }
   }
 }
Example #2
0
  @Override
  public Boolean visit(final EnumDeclaration n1, final Node arg) {
    final EnumDeclaration n2 = (EnumDeclaration) arg;

    // javadoc are checked at CompilationUnit

    if (n1.getModifiers() != n2.getModifiers()) {
      return Boolean.FALSE;
    }

    if (!objEquals(n1.getName(), n2.getName())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getImplements(), n2.getImplements())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getEntries(), n2.getEntries())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getMembers(), n2.getMembers())) {
      return Boolean.FALSE;
    }

    return Boolean.TRUE;
  }