public void visit(ClassOrInterfaceDeclaration n, A arg) {
    if (n.getJavaDoc() != null) {
      n.getJavaDoc().accept(this, arg);
    }
    if (n.getAnnotations() != null) {
      for (AnnotationExpr a : n.getAnnotations()) {
        a.accept(this, arg);
      }
    }
    if (n.getTypeParameters() != null) {
      for (TypeParameter t : n.getTypeParameters()) {
        t.accept(this, arg);
      }
    }
    if (n.getExtends() != null) {
      for (ClassOrInterfaceType c : n.getExtends()) {
        c.accept(this, arg);
      }
    }

    if (n.getImplements() != null) {
      for (ClassOrInterfaceType c : n.getImplements()) {
        c.accept(this, arg);
      }
    }
    if (n.getMembers() != null) {
      for (BodyDeclaration member : n.getMembers()) {
        member.accept(this, arg);
      }
    }
  }
Пример #2
0
  public void visit(ClassOrInterfaceDeclaration n, Object arg) {
    if (n.getJavaDoc() != null) {
      n.getJavaDoc().accept(this, arg);
    }
    printMemberAnnotations(n.getAnnotations(), arg);
    printModifiers(n.getModifiers());

    if (n.isInterface()) {
    } else {
    }

    printTypeParameters(n.getTypeParameters(), arg);

    Scope currentScope = (Scope) n.getData();
    ClassSymbol currentClass = (ClassSymbol) currentScope.resolve(n.getName());
    if (n.getExtends() != null) {
      for (Iterator<ClassOrInterfaceType> i = n.getExtends().iterator(); i.hasNext(); ) {
        ClassOrInterfaceType c = i.next();
        c.accept(this, arg);
        ClassSymbol parentClass = (ClassSymbol) currentScope.resolve((c.getName()));
        currentClass.setInheritedScope(parentClass);

        if (i.hasNext()) {}
      }
    }

    if (n.getImplements() != null) {
      for (Iterator<ClassOrInterfaceType> i = n.getImplements().iterator(); i.hasNext(); ) {
        ClassOrInterfaceType c = i.next();
        c.accept(this, arg);
        if (i.hasNext()) {}
      }
    }

    if (n.getMembers() != null) {
      printMembers(n.getMembers(), arg);
    }
  }