public final class AstTreeStringPrinter extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AstTreeStringPrinter.PrintOptions
Enum to be used for test if comments should be printed.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
printAst(FileText text,
AstTreeStringPrinter.PrintOptions withComments)
Parse a file and print the parse tree.
|
static String |
printFileAst(File file,
AstTreeStringPrinter.PrintOptions withComments)
Parse a file and print the parse tree.
|
static String |
printJavaAndJavadocTree(File file)
Prints full AST (java + comments + javadoc) of the java file.
|
public static String printFileAst(File file, AstTreeStringPrinter.PrintOptions withComments) throws IOException, CheckstyleException
file - the file to print.withComments - true to include comments to ASTIOException - if the file could not be read.CheckstyleException - if the file is not a Java source.public static String printJavaAndJavadocTree(File file) throws IOException, CheckstyleException
file - java fileIOException - Failed to open a fileCheckstyleException - error while parsing the filepublic static String printAst(FileText text, AstTreeStringPrinter.PrintOptions withComments) throws CheckstyleException
text - the text to parse.withComments - true to include comments to ASTCheckstyleException - if the file is not a Java source.Copyright © 2001-2017. All Rights Reserved.