public final class JavaParser extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JavaParser.Options
Enum to be used for test if comments should be used.
|
Modifier and Type | Method and Description |
---|---|
static DetailAST |
appendHiddenCommentNodes(DetailAST root)
Appends comment nodes to existing AST.
|
static DetailAST |
parse(FileContents contents)
Static helper method to parses a Java source file.
|
static DetailAST |
parseFile(File file,
JavaParser.Options options)
Parses Java source file.
|
static DetailAST |
parseFileText(FileText text,
JavaParser.Options options)
Parse a text and return the parse tree.
|
public static DetailAST parse(FileContents contents) throws CheckstyleException
contents
- contains the contents of the fileCheckstyleException
- if the contents is not a valid Java sourcepublic static DetailAST parseFileText(FileText text, JavaParser.Options options) throws CheckstyleException
text
- the text to parseoptions
- JavaParser.Options
to control inclusion of comment nodesCheckstyleException
- if the text is not a valid Java sourcepublic static DetailAST parseFile(File file, JavaParser.Options options) throws IOException, CheckstyleException
file
- the file to parseoptions
- JavaParser.Options
to control inclusion of comment nodesIOException
- if the file could not be readCheckstyleException
- if the file is not a valid Java source filepublic static DetailAST appendHiddenCommentNodes(DetailAST root)
root
- of ASTCopyright © 2001–2018. All rights reserved.