com.sun.mirror.util |
Utilities to assist in the processing of {@linkplain
com.sun.mirror.declaration declarations} and {@linkplain
com.sun.mirror.type types}.
Note that the apt tool and its associated APIs may be
changed or superseded in future j2se releases.
@since 1.5
|
Java Source File Name | Type | Comment |
DeclarationFilter.java | Class | A filter for selecting just the items of interest
from a collection of declarations.
The filter is said to select or to match those declarations.
Filters can be created in several ways:
by the static methods described below,
by negating or composing existing filters,
or by subclasses that implement arbitrary matching rules.
A subclass can create an arbitrary filter simply by implementing
the
DeclarationFilter.matches(Declaration) method.
Examples.
Selecting the public declarations from a collection:
result = FILTER_PUBLIC.filter(decls);
Selecting class declarations (including enums):
classFilter = DeclarationFilter.getFilter(ClassDeclaration.class);
result = classFilter.filter(decls);
Selecting class declarations but excluding enums:
enumFilter = DeclarationFilter.getFilter(EnumDeclaration.class);
compoundFilter = classFilter.and(enumFilter.not());
result = compoundFilter.filter(decls);
Selecting declarations named "Bob":
nameFilter = new DeclarationFilter() {
public boolean matches(Declaration d) {
return d.getSimpleName().equals("Bob");
}
};
result = nameFilter.filter(decls);
author: Joseph D. |
Declarations.java | Interface | Utility methods for operating on declarations.
author: Joseph D. |
DeclarationScanner.java | Class | A visitor for declarations that scans declarations contained within
the given declaration. |
DeclarationVisitor.java | Interface | A visitor for declarations, in the style of the standard visitor
design pattern. |
DeclarationVisitors.java | Class | Utilities to create specialized DeclarationVisitor instances.
author: Joseph D. |
SimpleDeclarationVisitor.java | Class | A simple visitor for declarations.
The implementations of the methods of this class do nothing but
delegate up the declaration hierarchy. |
SimpleTypeVisitor.java | Class | A simple visitor for types.
The implementations of the methods of this class do nothing but
delegate up the type hierarchy. |
SourceOrderDeclScanner.java | Class | A visitor for declarations that scans declarations contained within
the given declaration in source code order. |
SourcePosition.java | Interface | Represents a position in a source file.
author: Joseph D. |
Types.java | Interface | Utility methods for operating on types.
author: Joseph D. |
TypeVisitor.java | Interface | A visitor for types, in the style of the standard visitor design pattern.
This is used to operate on a type when the kind
of type is unknown at compile time.
When a visitor is passed to a type's
TypeMirror.accept accept method,
the most specific visitXxx method applicable to
that type is invoked.
author: Joseph D. |