Package org.checkerframework.afu.annotator.find
package org.checkerframework.afu.annotator.find
Provides interfaces and classes for finding where in the existing source to insert annotations
etc.
TreeFinder
manages the control flow and
discovers the positions for insertion, relying on implementations of Criterion
for determining whether an insertion should be
made at a given location and on extensions of Insertion
for the concrete text to be inserted.
The current flow, given a collection of insertions and an abstract syntax tree (AST)
representing a Java source file, consists of a pre-order traversal of the AST to find insertion
positions, followed by the insertion of text for each positioned Insertion
into the source code, in reverse order by
position. At each annotatable node encountered during the traversal, the program checks the
Criteria
for each yet-unmatched Insertion
against the current node; when there is a
match, the program finds and records the appropriate source position.
- See Also:
-
ClassDescriptionSpecifies an annotation to be inserted into a source file.A criterion to determine if a node matches a path through the AST.Utility class for dealing with CaseTree.Criterion for being a specific type cast expression.Specifies an insertion of a cast into a source file.This insertion adds two closing parentheses to close the unclosed parentheses left by a
CastInsertion
.Represents a set of Criterion objects for locating a program element in a source tree.A criterion for locating a program element in an AST.Types of criterion.A criterion to find a given extends or implements clause.GenericArrayLocationCriterion represents the criterion specifying the location of an element in the generic/array hierarchy as specified by the JSR 308 proposal.Represents the criterion that a program element is in a class with a particular name.Criterion for being within a specific field initializer.Criterion for being within a specific initializer.Specifies something that needs to be inserted into a source file, including the "what" and the "where".A collection ofInsertion
s, indexed by outer class and inner class.A criterion that matches a method with a specific signature (name, argument types, and return type).Criterion for being a specific local variable.Criterion for being a specific object creation expression.An insertion for a method receiver.Matches a return type.ATreeScanner
that is able to locate program elements in an AST based onCriteria
.Specifies an insertion of an "extends @Annotation java.lang.Object" to a type bound.An insertion that may result in code generation other than just annotations.