public class JavaParser extends Object
| Modifier and Type | Method and Description |
|---|---|
static CompilationUnit |
parse(File file)
Parses the Java code contained in a
File and returns
a CompilationUnit that represents it. |
static CompilationUnit |
parse(InputStream in)
Parses the Java code contained in the
InputStream and returns
a CompilationUnit that represents it. |
static CompilationUnit |
parse(InputStream in,
ParserConfigurator parserConfigurator)
Parses the Java code contained in the
InputStream and returns
a CompilationUnit that represents it. |
static CompilationUnit |
parse(String javaSource)
Parses a UTF-8 encoded string as java source.
|
static void |
printLex(InputStream in) |
public static CompilationUnit parse(InputStream in) throws IOException, ParseException
InputStream and returns
a CompilationUnit that represents it.in - InputStream containing Java source codeIOExceptionParseExceptionpublic static CompilationUnit parse(InputStream in, ParserConfigurator parserConfigurator) throws IOException, ParseException
InputStream and returns
a CompilationUnit that represents it.in - InputStream containing Java source codein - ParserConfigurator to configure the parser before processing.IOExceptionParseExceptionpublic static CompilationUnit parse(File file) throws IOException, ParseException
File and returns
a CompilationUnit that represents it.file - File containing Java source codeIOExceptionParseExceptionpublic static CompilationUnit parse(String javaSource) throws IOException, ParseException
javaSource - IOExceptionParseExceptionpublic static void printLex(InputStream in) throws Exception
ExceptionCopyright © 2015. All Rights Reserved.