JavaParser

Parse Java source code and creates Abstract Syntax Trees.

Author

Júlio Vilmar Gesser

See also

Constructors

Link copied to clipboard
constructor()
Instantiate the parser with default configuration.
constructor(configuration: ParserConfiguration)
Instantiate the parser.

Functions

Link copied to clipboard
open fun parse(file: File, encoding: Charset): ParseResult<CompilationUnit>
Parses the Java code contained in a File and returns a CompilationUnit that represents it.
Parses the Java code contained in the InputStream and returns a CompilationUnit that represents it.
Parses Java code from a Reader and returns a CompilationUnit that represents it.
Parses the Java code contained in code and returns a CompilationUnit that represents it.
open fun parse(path: Path, encoding: Charset): ParseResult<CompilationUnit>
Parses the Java code contained in a file and returns a CompilationUnit that represents it.
open fun <N : Node?> parse(start: ParseStart<N>, provider: Provider): ParseResult<N>
Parses source code.
Link copied to clipboard
Parses the Java annotation contained in a String and returns a AnnotationExpr that represents it.
Link copied to clipboard
Parses the Java annotation body declaration(e.
Link copied to clipboard
Parses an array initializer expression and returns it as ArrayInitializerExpr.
Link copied to clipboard
open fun parseBlock(blockStatement: String): ParseResult<BlockStmt>
Parses the Java block contained in a String and returns a BlockStmt that represents it.
Link copied to clipboard
Parses a Java class or interface body declaration(e.
Link copied to clipboard
Parses a Java class or interface type name and returns a ClassOrInterfaceType that represents it.
Link copied to clipboard
Parses the this(...) and super(...) statements that may occur at the start of a constructor.
Link copied to clipboard
open fun <T : Expression?> parseExpression(expression: String): ParseResult<T>
Parses the Java expression contained in a String and returns a Expression that represents it.
Link copied to clipboard
open fun parseImport(importDeclaration: String): ParseResult<ImportDeclaration>
Parses the Java import contained in a String and returns a ImportDeclaration that represents it.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Parses a method declaration and returns it as a MethodDeclaration.
Link copied to clipboard
Parses a module declaration and returns it as a ModuleDeclaration.
Link copied to clipboard
Parses a module directive and returns it as a ModuleDirective.
Link copied to clipboard
open fun parseName(qualifiedName: String): ParseResult<Name>
Parses a qualified name (one that can have "."s in it) and returns it as a Name.
Link copied to clipboard
Parses a package declaration and returns it as a PackageDeclaration.
Link copied to clipboard
Parses a single parameter (a type and a name) and returns it as a Parameter.
Link copied to clipboard
open fun parseResource(classLoader: ClassLoader, path: String, encoding: Charset): ParseResult<CompilationUnit>
Parses the Java code contained in a resource and returns a CompilationUnit that represents it.
Link copied to clipboard
Link copied to clipboard
Parses a simple name (one that can NOT have "."s in it) and returns it as a SimpleName.
Link copied to clipboard
Parses the Java statement contained in a String and returns a Statement that represents it.
Link copied to clipboard
TODO weigl
Link copied to clipboard
open fun parseType(type: String): ParseResult<Type>
Parses a Java type name and returns a Type that represents it.
Link copied to clipboard
open fun parseTypeDeclaration(typeDeclaration: String): ParseResult<TypeDeclaration<out Any>>
Parses a type declaration and returns it as a TypeDeclaration.
Link copied to clipboard
Parses a type parameter and returns it as a TypeParameter
Link copied to clipboard
Parses a variable declaration expression and returns a com.github.javaparser.ast.expr.VariableDeclarationExpr that represents it.