StaticJavaParser
| Modifier and Type | Field and Description |
|---|---|
| private GeneratedJavaParser | |
| private final ParserConfiguration |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ParserConfiguration | |
| private GeneratedJavaParser | |
| public < the subclass of Node that is the result of parsing in the start. N extends Node> ParseResult | Returns: the parse result, a collection of encountered problems, and some extra data.refer to the constants in ParseStart to see what can be parsed. start, Provider refer to Providers to see how you can read source. The provider will be closed after parsing. provider)Parses source code. |
| public ParseResult | Returns: CompilationUnit representing the Java source codeInputStream containing Java source code. It will be closed after parsing.encoding of the source code encoding)Parses the Java code contained in the |
| public ParseResult | Returns: CompilationUnit representing the Java source codeInputStream containing Java source code. It will be closed after parsing.Parses the Java code contained in the |
| public ParseResult | Returns: CompilationUnit representing the Java source codeFile containing Java source code. It will be closed after parsing.encoding of the source code encoding)
Deprecated
set the encoding in the
Parses the Java code contained in a ParserConfiguration
File and returns a
CompilationUnit that represents it.
|
| public ParseResult | Returns: CompilationUnit representing the Java source codeFile containing Java source code. It will be closed after parsing.Parses the Java code contained in a |
| public ParseResult | Returns: CompilationUnit representing the Java source codepath to a file containing Java source code path, final Charset encoding of the source code encoding)
Deprecated
set the encoding in the
Parses the Java code contained in a file and returns a
ParserConfiguration
CompilationUnit that represents it.
|
| public ParseResult | Returns: CompilationUnit representing the Java source codepath to a file containing Java source code path)Parses the Java code contained in a file and returns a
|
| public ParseResult | Returns: CompilationUnit representing the Java source codethe reader containing Java source code. It will be closed after parsing. reader)Parses Java code from a Reader and returns a
|
| public ParseResult | Returns: CompilationUnit representing the Java source codeJava source code code)Parses the Java code contained in code and returns a
|
| public ParseResult | Returns: AnnotationExpr representing the Java annotationString containing Java annotationParses the Java annotation contained in a |
| public ParseResult | Returns: BodyDeclaration representing the Java annotationString containing Java body declarationParses the Java annotation body declaration(e.g fields or methods) contained in a
|
| public ParseResult | Returns: BlockStmt representing the Java blockString containing Java block codeParses the Java block contained in a |
| public <T extends BodyDeclaration | Returns: BodyDeclaration representing the Java interface bodythe body of a class or interface body)Parses a Java class or interface body declaration(e.g fields or methods) and returns a
|
| public ParseResult | Returns: ClassOrInterfaceType representing the typethe type name like a.b.c.X or Y type)Parses a Java class or interface type name and returns a |
| public ParseResult | Returns: the AST for the statement.a statement like super("hello"); statement)Parses the this(...) and super(...) statements that may occur at the start of a constructor. |
| public <T extends Expression> ParseResult | Returns: Expression representing the Java expressionString containing Java expressionParses the Java expression contained in a |
| public ParseResult | Returns: ImportDeclaration representing the Java import declarationString containing Java import codeParses the Java import contained in a |
| public ParseResult | Returns: the AST for the method declarationa method declaration like "void foo() {}" methodDeclaration)Parses a method declaration and returns it as a MethodDeclaration. |
| public ParseResult | Returns: the AST for the module declarationa declaration like "module X {}" moduleDeclaration)Parses a module declaration and returns it as a ModuleDeclaration. |
| public ParseResult | Returns: the AST for the module directivea directive like "opens C;" moduleDirective)Parses a module directive and returns it as a ModuleDirective. |
| public ParseResult | |
| public ParseResult | Returns: the AST for the parametera declaration like "package com.microsoft.java;" packageDeclaration)Parses a package declaration and returns it as a PackageDeclaration. |
| public ParseResult | Returns: the AST for the parametera parameter like "int[] x" parameter)Parses a single parameter (a type and a name) and returns it as a Parameter. |
| public ParseResult | Returns: CompilationUnit representing the Java source codepath to a resource containing Java source code. As resource is accessed through a class loader, a
leading "/" is not allowed in pathToResource path)Parses the Java code contained in a resource and returns a
|
| public ParseResult | Returns: CompilationUnit representing the Java source codepath to a resource containing Java source code. As resource is accessed through a class loader, a
leading "/" is not allowed in pathToResource path, Charset encoding of the source code encoding)
Deprecated
set the encoding in the
Parses the Java code contained in a resource and returns a
ParserConfiguration
CompilationUnit that represents it.
|
| public ParseResult | Returns: CompilationUnit representing the Java source codethe classLoader that is asked to load the resource classLoader, final String path to a resource containing Java source code. As resource is accessed through a class loader, a
leading "/" is not allowed in pathToResource path, Charset encoding)
Deprecated
set the encoding in the
Parses the Java code contained in a resource and returns a
ParserConfiguration
CompilationUnit that represents it.
|
| public ParseResult | Returns: the AST for the namea name like "parameter_source" name)Parses a simple name (one that can NOT have "."s in it) and returns it as a SimpleName. |
| public ParseResult | Returns: Statement representing the Java statementString containing Java statement codeParses the Java statement contained in a |
| public ParseResult | |
| public ParseResult | Returns: the AST for the type declarationa declaration like "class X {}" typeDeclaration)Parses a type declaration and returns it as a TypeDeclaration. |
| public ParseResult | Returns: the AST for the type parametera parameter like "T extends Serializable" typeParameter)Parses a type parameter and returns it as a TypeParameter |
| public ParseResult | Returns: VariableDeclarationExpr representing the typea variable declaration like declaration)int x=2;Parses a variable declaration expression and returns a |
| astParser | back to summary |
|---|---|
| private GeneratedJavaParser astParser | |
| configuration | back to summary |
|---|---|
| private final ParserConfiguration configuration | |
| JavaParser | back to summary |
|---|---|
| public JavaParser() Instantiate the parser with default configuration. Note that parsing can also be done with the static methods | |
| JavaParser | back to summary |
|---|---|
| public JavaParser(ParserConfiguration configuration) Instantiate the parser. Note that parsing can also be done with the static methods | |
| getParserConfiguration | back to summary |
|---|---|
public ParserConfiguration getParserConfiguration()
| |
| getParserForProvider | back to summary |
|---|---|
| private GeneratedJavaParser getParserForProvider(Provider provider) | |
| parse | back to summary |
|---|---|
| public <N extends Node> ParseResult Parses source code. It takes the source code from a Provider. The start indicates what can be found in the source code (compilation unit, block, import...)
| |
| parse | back to summary |
|---|---|
| public ParseResult Parses the Java code contained in the
| |
| parse | back to summary |
|---|---|
| public ParseResult Parses the Java code contained in the
| |
| parse | back to summary |
|---|---|
| public ParseResult Deprecated set the encoding in the Parses the Java code contained in a
| |
| parse | back to summary |
|---|---|
| public ParseResult Parses the Java code contained in a
| |
| parse | back to summary |
|---|---|
| public ParseResult Deprecated set the encoding in the Parses the Java code contained in a file and returns a
| |
| parse | back to summary |
|---|---|
| public ParseResult Parses the Java code contained in a file and returns a
| |
| parse | back to summary |
|---|---|
| public ParseResult Parses Java code from a Reader and returns a
| |
| parse | back to summary |
|---|---|
| public ParseResult Parses the Java code contained in code and returns a
| |
| parseAnnotation | back to summary |
|---|---|
| public ParseResult Parses the Java annotation contained in a
| |
| parseAnnotationBodyDeclaration | back to summary |
|---|---|
| public ParseResult Parses the Java annotation body declaration(e.g fields or methods) contained in a
| |
| parseBlock | back to summary |
|---|---|
| public ParseResult Parses the Java block contained in a
| |
| parseBodyDeclaration | back to summary |
|---|---|
| public <T extends BodyDeclaration Parses a Java class or interface body declaration(e.g fields or methods) and returns a
| |
| parseClassOrInterfaceType | back to summary |
|---|---|
| public ParseResult Parses a Java class or interface type name and returns a
| |
| parseExplicitConstructorInvocationStmt | back to summary |
|---|---|
| public ParseResult Parses the this(...) and super(...) statements that may occur at the start of a constructor.
| |
| parseExpression | back to summary |
|---|---|
| public <T extends Expression> ParseResult Parses the Java expression contained in a
| |
| parseImport | back to summary |
|---|---|
| public ParseResult Parses the Java import contained in a
| |
| parseMethodDeclaration | back to summary |
|---|---|
| public ParseResult Parses a method declaration and returns it as a MethodDeclaration.
| |
| parseModuleDeclaration | back to summary |
|---|---|
| public ParseResult Parses a module declaration and returns it as a ModuleDeclaration.
| |
| parseModuleDirective | back to summary |
|---|---|
| public ParseResult Parses a module directive and returns it as a ModuleDirective.
| |
| parseName | back to summary |
|---|---|
| public ParseResult Parses a qualified name (one that can have "."s in it) and returns it as a Name.
| |
| parsePackageDeclaration | back to summary |
|---|---|
| public ParseResult Parses a package declaration and returns it as a PackageDeclaration.
| |
| parseParameter | back to summary |
|---|---|
| public ParseResult Parses a single parameter (a type and a name) and returns it as a Parameter.
| |
| parseResource | back to summary |
|---|---|
| public ParseResult Parses the Java code contained in a resource and returns a
| |
| parseResource | back to summary |
|---|---|
| public ParseResult Deprecated set the encoding in the Parses the Java code contained in a resource and returns a
| |
| parseResource | back to summary |
|---|---|
| public ParseResult Deprecated set the encoding in the Parses the Java code contained in a resource and returns a
| |
| parseSimpleName | back to summary |
|---|---|
| public ParseResult Parses a simple name (one that can NOT have "."s in it) and returns it as a SimpleName.
| |
| parseStatement | back to summary |
|---|---|
| public ParseResult Parses the Java statement contained in a
| |
| parseType | back to summary |
|---|---|
| public ParseResult Parses a Java type name and returns a
| |
| parseTypeDeclaration | back to summary |
|---|---|
| public ParseResult Parses a type declaration and returns it as a TypeDeclaration.
| |
| parseTypeParameter | back to summary |
|---|---|
| public ParseResult Parses a type parameter and returns it as a TypeParameter
| |
| parseVariableDeclarationExpr | back to summary |
|---|---|
| public ParseResult Parses a variable declaration expression and returns a
| |