public final class AstTreeStringPrinter extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
printAst(FileText text,
JavaParser.Options options)
Parse a file and print the parse tree.
|
static java.lang.String |
printBranch(DetailAST node)
Print branch info from root down to given
node. |
static java.lang.String |
printFileAst(java.io.File file,
JavaParser.Options options)
Parse a file and print the parse tree.
|
static java.lang.String |
printJavaAndJavadocTree(java.io.File file)
Prints full AST (java + comments + javadoc) of the java file.
|
public static java.lang.String printFileAst(java.io.File file, JavaParser.Options options) throws java.io.IOException, CheckstyleException
file - the file to print.options - JavaParser.Options to control the inclusion of comment nodes.java.io.IOException - if the file could not be read.CheckstyleException - if the file is not a Java source.public static java.lang.String printJavaAndJavadocTree(java.io.File file) throws java.io.IOException, CheckstyleException
file - java filejava.io.IOException - Failed to open a fileCheckstyleException - error while parsing the filepublic static java.lang.String printAst(FileText text, JavaParser.Options options) throws CheckstyleException
text - the text to parse.options - JavaParser.Options to control the inclusion of comment nodes.CheckstyleException - if the file is not a Java source.public static java.lang.String printBranch(DetailAST node)
node.node - last item of the branchCopyright © 2001-2020. All Rights Reserved.