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 codeIOException
ParseException
public 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.IOException
ParseException
public static CompilationUnit parse(File file) throws IOException, ParseException
File
and returns
a CompilationUnit
that represents it.file
- File
containing Java source codeIOException
ParseException
public static CompilationUnit parse(String javaSource) throws IOException, ParseException
javaSource
- IOException
ParseException
public static void printLex(InputStream in) throws Exception
Exception
Copyright © 2014. All Rights Reserved.