public final class JavaParser
extends java.lang.Object
This class was generated automatically by javacc, do not edit.
Parse Java 1.5 source code and creates Abstract Syntax Tree classes.
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getDoNotAssignCommentsPreceedingEmptyLines() |
static boolean |
getDoNotConsiderAnnotationsAsNodeStartForCodeAttribution() |
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.File file,
java.lang.String encoding) |
static CompilationUnit |
parse(java.io.File file,
java.lang.String encoding,
boolean considerComments)
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,
java.lang.String encoding) |
static CompilationUnit |
parse(java.io.InputStream in,
java.lang.String encoding,
boolean considerComments)
Parses the Java code contained in the
InputStream and returns a
CompilationUnit that represents it. |
static CompilationUnit |
parse(java.io.Reader reader,
boolean considerComments) |
static AnnotationExpr |
parseAnnotation(java.lang.String annotation)
Parses the Java annotation contained in a
String and returns a
AnnotationExpr that represents it. |
static BlockStmt |
parseBlock(java.lang.String blockStatement)
Parses the Java block contained in a
String and returns a
BlockStmt that represents it. |
static BodyDeclaration |
parseBodyDeclaration(java.lang.String body)
Parses the Java body declaration(e.g fields or methods) contained in a
String and returns a BodyDeclaration that represents it. |
static Expression |
parseExpression(java.lang.String expression)
Parses the Java expression contained in a
String and returns a
Expression that represents it. |
static ImportDeclaration |
parseImport(java.lang.String importDeclaration)
Parses the Java import contained in a
String and returns a
ImportDeclaration that represents it. |
static Statement |
parseStatement(java.lang.String statement)
Parses the Java statement contained in a
String and returns a
Statement that represents it. |
static void |
setDoNotAssignCommentsPreceedingEmptyLines(boolean doNotAssignCommentsPreceedingEmptyLines) |
static void |
setDoNotConsiderAnnotationsAsNodeStartForCodeAttribution(boolean doNotConsiderAnnotationsAsNodeStartForCodeAttribution) |
public static boolean getDoNotConsiderAnnotationsAsNodeStartForCodeAttribution()
public static void setDoNotConsiderAnnotationsAsNodeStartForCodeAttribution(boolean doNotConsiderAnnotationsAsNodeStartForCodeAttribution)
public static boolean getDoNotAssignCommentsPreceedingEmptyLines()
public static void setDoNotAssignCommentsPreceedingEmptyLines(boolean doNotAssignCommentsPreceedingEmptyLines)
public static CompilationUnit parse(java.io.InputStream in, java.lang.String encoding) throws ParseException
ParseExceptionpublic static CompilationUnit parse(java.io.InputStream in, java.lang.String encoding, boolean considerComments) 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(java.io.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(java.io.File file, java.lang.String encoding) throws ParseException, java.io.IOException
ParseExceptionjava.io.IOExceptionpublic static CompilationUnit parse(java.io.File file, java.lang.String encoding, boolean considerComments) throws ParseException, java.io.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 errorsjava.io.IOExceptionpublic static CompilationUnit parse(java.io.File file) throws ParseException, java.io.IOException
File and returns a
CompilationUnit that represents it.file - File containing Java source codeParseException - if the source code has parser errorsjava.io.IOExceptionpublic static CompilationUnit parse(java.io.Reader reader, boolean considerComments) throws ParseException
ParseExceptionpublic static BlockStmt parseBlock(java.lang.String blockStatement) throws ParseException
String and returns a
BlockStmt that represents it.blockStatement - String containing Java block codeParseException - if the source code has parser errorspublic static Statement parseStatement(java.lang.String statement) throws ParseException
String and returns a
Statement that represents it.statement - String containing Java statement codeParseException - if the source code has parser errorspublic static ImportDeclaration parseImport(java.lang.String importDeclaration) throws ParseException
String and returns a
ImportDeclaration that represents it.importDeclaration - String containing Java import codeParseException - if the source code has parser errorspublic static Expression parseExpression(java.lang.String expression) throws ParseException
String and returns a
Expression that represents it.expression - String containing Java expressionParseException - if the source code has parser errorspublic static AnnotationExpr parseAnnotation(java.lang.String annotation) throws ParseException
String and returns a
AnnotationExpr that represents it.annotation - String containing Java annotationParseException - if the source code has parser errorspublic static BodyDeclaration parseBodyDeclaration(java.lang.String body) throws ParseException
String and returns a BodyDeclaration that represents it.body - String containing Java body declarationParseException - if the source code has parser errorsCopyright © 2007-2015. All Rights Reserved.