parseResource

Parses the Java code contained in a resource and returns a CompilationUnit that represents it.

Return

CompilationUnit representing the Java source code

Parameters

path

path to a resource containing Java source code. As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource

Throws

the path could not be accessed


Deprecated

set the encoding in the ParserConfiguration

Parses the Java code contained in a resource and returns a CompilationUnit that represents it.

Return

CompilationUnit representing the Java source code

Parameters

path

path to a resource containing Java source code. As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource

encoding

encoding of the source code

Throws

the path could not be accessed


open fun parseResource(classLoader: ClassLoader, path: String, encoding: Charset): ParseResult<CompilationUnit>(source)

Deprecated

set the encoding in the ParserConfiguration

Parses the Java code contained in a resource and returns a CompilationUnit that represents it.

Return

CompilationUnit representing the Java source code

Parameters

classLoader

the classLoader that is asked to load the resource

path

path to a resource containing Java source code. As resource is accessed through a class loader, a leading "/" is not allowed in pathToResource

Throws

the path could not be accessed