Пример #1
0
  public void visit(EnumDeclaration n, Object arg) {
    if (n.getJavaDoc() != null) {
      n.getJavaDoc().accept(this, arg);
    }
    printMemberAnnotations(n.getAnnotations(), arg);
    printModifiers(n.getModifiers());

    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.getEntries() != null) {
      for (Iterator<EnumConstantDeclaration> i = n.getEntries().iterator(); i.hasNext(); ) {
        EnumConstantDeclaration e = i.next();
        e.accept(this, arg);
        if (i.hasNext()) {}
      }
    }
    if (n.getMembers() != null) {
      printMembers(n.getMembers(), arg);
    } else {
      if (n.getEntries() != null) {}
    }
  }
Пример #2
0
 public void visit(TypeParameter n, Object arg) {
   if (n.getTypeBound() != null) {
     for (Iterator<ClassOrInterfaceType> i = n.getTypeBound().iterator(); i.hasNext(); ) {
       ClassOrInterfaceType c = i.next();
       c.accept(this, arg);
       if (i.hasNext()) {}
     }
   }
 }
Пример #3
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);
    }
  }
Пример #4
0
 public void visit(ClassOrInterfaceType n, Object arg) {
   if (n.getScope() != null) {
     n.getScope().accept(this, arg);
   }
   printTypeArgs(n.getTypeArgs(), arg);
 }