public class InstanceJavaParser extends Object
Constructor and Description |
---|
InstanceJavaParser(File file) |
InstanceJavaParser(File file,
String encoding) |
InstanceJavaParser(InputStream input) |
InstanceJavaParser(InputStream input,
String encoding) |
InstanceJavaParser(Provider provider) |
InstanceJavaParser(Reader reader) |
InstanceJavaParser(String source) |
Modifier and Type | Method and Description |
---|---|
List<Token> |
getTokens()
Return the list of tokens that have been encountered while parsing code
using this parser.
|
CompilationUnit |
parse()
Parses the Java code and returns a
CompilationUnit that
represents it. |
AnnotationExpr |
parseAnnotation()
Parses the Java annotation and returns a
AnnotationExpr that
represents it. |
BlockStmt |
parseBlock()
Parses the Java block and returns a
BlockStmt that represents it. |
BodyDeclaration |
parseBodyDeclaration()
Parses the Java body declaration(e.g fields or methods) and returns a
BodyDeclaration that represents it. |
BodyDeclaration |
parseClassBodyDeclaration()
Parses a Java class body declaration(e.g fields or methods) and returns a
BodyDeclaration that represents it. |
Expression |
parseExpression()
Parses the Java expression and returns a
Expression that
represents it. |
ImportDeclaration |
parseImport()
Parses the Java import and returns a
ImportDeclaration that
represents it. |
BodyDeclaration |
parseInterfaceBodyDeclaration()
Parses a Java interface body declaration(e.g fields or methods) and returns a
BodyDeclaration that represents it. |
Statement |
parseStatement()
Parses the Java statement and returns a
Statement that represents
it. |
List<Statement> |
parseStatements()
|
public InstanceJavaParser(Provider provider)
public InstanceJavaParser(Reader reader)
public InstanceJavaParser(InputStream input) throws IOException
IOException
public InstanceJavaParser(InputStream input, String encoding) throws IOException
IOException
public InstanceJavaParser(File file) throws IOException
IOException
public InstanceJavaParser(File file, String encoding) throws IOException
IOException
public InstanceJavaParser(String source)
public List<Token> getTokens()
public CompilationUnit parse() throws ParseException
CompilationUnit
that
represents it.ParseException
- if the source code has parser errorspublic BlockStmt parseBlock() throws ParseException
BlockStmt
that represents it.ParseException
- if the source code has parser errorspublic List<Statement> parseStatements() throws ParseException
ParseException
- if the source code has parser errorspublic Statement parseStatement() throws ParseException
Statement
that represents
it.ParseException
- if the source code has parser errorspublic ImportDeclaration parseImport() throws ParseException
ImportDeclaration
that
represents it.ParseException
- if the source code has parser errorspublic Expression parseExpression() throws ParseException
Expression
that
represents it.ParseException
- if the source code has parser errorspublic AnnotationExpr parseAnnotation() throws ParseException
AnnotationExpr
that
represents it.ParseException
- if the source code has parser errorspublic BodyDeclaration parseBodyDeclaration() throws ParseException
BodyDeclaration
that represents it.ParseException
- if the source code has parser errorspublic BodyDeclaration parseClassBodyDeclaration() throws ParseException
BodyDeclaration
that represents it.ParseException
- if the source code has parser errorspublic BodyDeclaration parseInterfaceBodyDeclaration() throws ParseException
BodyDeclaration
that represents it.ParseException
- if the source code has parser errorsCopyright © 2007–2016. All rights reserved.