SourceOrderDeclScannerpublic class SourceOrderDeclScanner extends DeclarationScanner A visitor for declarations that scans declarations contained within
the given declaration in source code order. For example, when
visiting a class, the methods, fields, constructors, and nested
types of the class are also visited.
To control the processing done on a declaration, users of this
class pass in their own visitors for pre and post processing. The
preprocessing visitor is called before the contained declarations
are scanned; the postprocessing visitor is called after the
contained declarations are scanned. |
Fields Summary |
---|
static final Comparator | comparator |
Methods Summary |
---|
public void | visitClassDeclaration(com.sun.mirror.declaration.ClassDeclaration d)Visits a class declaration.
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(ConstructorDeclaration ctorDecl: d.getConstructors()) {
decls.add(ctorDecl);
}
for(Declaration decl: decls )
decl.accept(this);
d.accept(post);
| public void | visitExecutableDeclaration(com.sun.mirror.declaration.ExecutableDeclaration d)
d.accept(pre);
SortedSet<Declaration> decls = new
TreeSet<Declaration>(SourceOrderDeclScanner.comparator) ;
for(TypeParameterDeclaration tpDecl: d.getFormalTypeParameters())
decls.add(tpDecl);
for(ParameterDeclaration pDecl: d.getParameters())
decls.add(pDecl);
for(Declaration decl: decls )
decl.accept(this);
d.accept(post);
| public void | visitTypeDeclaration(com.sun.mirror.declaration.TypeDeclaration d)Visits a type declaration.
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);
|
|