public final class JavaParser extends Object
This class was generated automatically by javacc, do not edit.
Parse Java 1.5 source code and creates Abstract Syntax Tree classes.
Note: To use this parser asynchronously, disable de parser cache by calling the method setCacheParser
with false
as argument.
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(File file,
String encoding)
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,
String encoding)
Parses the Java code contained in the
InputStream and returns
a CompilationUnit that represents it. |
static CompilationUnit |
parse(Reader in)
Parses the Java code contained in the
InputStream and returns
a CompilationUnit that represents it. |
static void |
setCacheParser(boolean value)
Changes the way that the parser acts when starts to parse.
|
public static void setCacheParser(boolean value)
false
.
By default, the cache is enabled.value
- false
to disable the parser instance cache.public static CompilationUnit parse(InputStream in, String encoding) throws ParseException
InputStream
and returns
a CompilationUnit
that represents it.in
- InputStream
containing Java source codeencoding
- encoding of the source codeParseException
- if the source code has parser errorspublic static CompilationUnit parse(InputStream in) throws ParseException
InputStream
and returns
a CompilationUnit
that represents it.in
- InputStream
containing Java source codeParseException
- if the source code has parser errorspublic static CompilationUnit parse(File file, String encoding) throws ParseException, IOException
File
and returns
a CompilationUnit
that represents it.file
- File
containing Java source codeencoding
- encoding of the source codeParseException
- if the source code has parser errorsIOException
public static CompilationUnit parse(File file) throws ParseException, IOException
File
and returns
a CompilationUnit
that represents it.file
- File
containing Java source codeParseException
- if the source code has parser errorsIOException
public static CompilationUnit parse(Reader in) throws ParseException
InputStream
and returns
a CompilationUnit
that represents it.in
- InputStream
containing Java source codeencoding
- encoding of the source codeParseException
- if the source code has parser errorsCopyright © 2016 Eclipse foundation. All rights reserved.