StaticJavaParser

A simpler, static API than JavaParser.

Functions

Link copied to clipboard
Get the configuration for the parse...
Link copied to clipboard
Get the configuration for the parse...
Link copied to clipboard
open fun parse(@NotNull file: File): CompilationUnit
open fun parse(@NotNull file: File, @NotNull encoding: Charset): CompilationUnit
Parses the Java code contained in a File and returns a CompilationUnit that represents it.
open fun parse(@NotNull in: InputStream, @NotNull encoding: Charset): CompilationUnit
Parses the Java code contained in the InputStream and returns a CompilationUnit that represents it.
open fun parse(@NotNull reader: Reader): CompilationUnit
Parses Java code from a Reader and returns a CompilationUnit that represents it.
open fun parse(@NotNull code: String): CompilationUnit
Parses the Java code contained in code and returns a CompilationUnit that represents it.
open fun parse(@NotNull path: Path): CompilationUnit
open fun parse(@NotNull path: Path, @NotNull encoding: Charset): CompilationUnit
Parses the Java code contained in a file and returns a CompilationUnit that represents it.
Link copied to clipboard
open fun parseAnnotation(@NotNull annotation: String): AnnotationExpr
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(@NotNull blockStatement: String): 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(@NotNull expression: String): T
Parses the Java expression contained in a String and returns a Expression that represents it.
Link copied to clipboard
open fun parseImport(@NotNull importDeclaration: String): ImportDeclaration
Parses the Java import contained in a String and returns a ImportDeclaration that represents it.
Link copied to clipboard
open fun parseJavadoc(@NotNull content: String, isMarkdownComment: Boolean): Javadoc
Parses the content of a JavadocComment and returns a Javadoc that represents it.
Link copied to clipboard
Link copied to clipboard
open fun parseJmlClause(content: String): JmlClause
Link copied to clipboard
open fun parseJmlContract(content: String): JmlContract
Link copied to clipboard
Link copied to clipboard
open fun <T : Expression?> parseJmlExpression(expression: String): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun parseMethodDeclaration(@NotNull methodDeclaration: String): MethodDeclaration
Parses a method declaration and returns it as a MethodDeclaration.
Link copied to clipboard
open fun parseModuleDeclaration(@NotNull moduleDeclaration: String): ModuleDeclaration
Parses a module declaration and returns it as a ModuleDeclaration.
Link copied to clipboard
open fun parseModuleDirective(@NotNull moduleDirective: String): ModuleDirective
Parses a module directive and returns it as a ModuleDirective.
Link copied to clipboard
open fun parseName(@NotNull qualifiedName: String): Name
Parses a qualified name (one that can have "."s in it) and returns it as a Name.
Link copied to clipboard
open fun parsePackageDeclaration(@NotNull packageDeclaration: String): PackageDeclaration
Parses a package declaration and returns it as a PackageDeclaration.
Link copied to clipboard
open fun parseParameter(@NotNull parameter: String): Parameter
Parses a single parameter (a type and a name) and returns it as a Parameter.
Link copied to clipboard
open fun parseResource(@NotNull path: String, @NotNull encoding: Charset): CompilationUnit
open fun parseResource(@NotNull classLoader: ClassLoader, @NotNull path: String, @NotNull encoding: Charset): CompilationUnit
Parses the Java code contained in a resource and returns a CompilationUnit that represents it.
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
open fun parseStatement(@NotNull statement: String): Statement
Parses the Java statement contained in a String and returns a Statement that represents it.
Link copied to clipboard
open fun parseType(@NotNull type: String): Type
Parses a Java type name and returns a Type that represents it.
Link copied to clipboard
open fun parseTypeDeclaration(@NotNull typeDeclaration: String): TypeDeclaration<out Any>
Parses a type declaration and returns it as a TypeDeclaration.
Link copied to clipboard
open fun parseTypeParameter(@NotNull typeParameter: String): TypeParameter
Parses a type parameter and returns it as a TypeParameter
Link copied to clipboard
Parses a variable declaration expression and returns a VariableDeclarationExpr that represents it.
Link copied to clipboard
open fun setConfiguration(@NotNull configuration: ParserConfiguration)
Set the configuration for the static parse...