Specialized visitor for running detectors on a Java AST.
It operates in three phases:
- First, it computes a set of maps where it generates a map from each
significant AST attribute (such as method call names) to a list
of detectors to consult whenever that attribute is encountered.
Examples of "attributes" are method names, Android resource identifiers,
and general AST node types such as "cast" nodes etc. These are
defined on the
Detector.JavaPsiScanner
interface.
- Second, it iterates over the document a single time, delegating to
the detectors found at each relevant AST attribute.
- Finally, it calls the remaining visitors (those that need to process a
whole document on their own).
It also notifies all the detectors before and after the document is processed
such that they can do pre- and post-processing.