/** * Visits a type declaration. * * @param d the declaration to visit */ public void visitTypeDeclaration(TypeDeclaration d) { d.accept(pre); SortedSet<Declaration> decls = new TreeSet<Declaration>(SourceOrderDeclScanner.comparator); for (TypeParameterDeclaration tpDecl : d.getFormalTypeParameters()) { decls.add(tpDecl); } for (FieldDeclaration fieldDecl : d.getFields()) { decls.add(fieldDecl); } for (MethodDeclaration methodDecl : d.getMethods()) { decls.add(methodDecl); } for (TypeDeclaration typeDecl : d.getNestedTypes()) { decls.add(typeDecl); } for (Declaration decl : decls) decl.accept(this); d.accept(post); }