@SupportedAnnotationTypes(value="*")
@SupportedSourceVersion(value=RELEASE_8)
public class TreeDebug
extends javax.annotation.processing.AbstractProcessor
The class is actually an annotation processor; in order to use it, invoke the compiler on the
source file(s) for which you wish to view the structure of the program. You may also wish to use
the -proc:only
javac option to stop compilation after annotation processing. (But, in
general -proc:only
causes type annotation processors not to be run.)
The utility will display the Tree.Kind
of each node it encounters while scanning the AST,
indented according to its depth in the tree. Additionally, the names of identifiers and member
selection trees are displayed (since these names are not tree nodes and therefore not directly
visited during AST traversal).
TreePrinter
Modifier and Type | Class and Description |
---|---|
static class |
TreeDebug.Visitor |
Constructor and Description |
---|
TreeDebug() |
Modifier and Type | Method and Description |
---|---|
protected TreeDebug.Visitor |
createSourceVisitor(CompilationUnitTree root) |
boolean |
process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations,
javax.annotation.processing.RoundEnvironment roundEnv) |
protected TreeDebug.Visitor createSourceVisitor(CompilationUnitTree root)
public boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
process
in interface javax.annotation.processing.Processor
process
in class javax.annotation.processing.AbstractProcessor