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