public static class ParsingJavaPackageFinder.PackagePathResolver extends Object
| Constructor and Description |
|---|
PackagePathResolver(JavaFileParser javaFileParser,
ProjectFilesystem projectFilesystem) |
| Modifier and Type | Method and Description |
|---|---|
Optional<Path> |
getPackagePathFromSource(Path sourcePath)
Tries to return the package path from a Java source file.
|
Optional<Path> |
getSourceRootFromSource(Path sourcePath)
Given a file at `a/b/c/D.java`, and full name of the class is `b.c.D`, the source root for
that file is `a`.
|
public PackagePathResolver(JavaFileParser javaFileParser, ProjectFilesystem projectFilesystem)
javaFileParser - parser to read Java sources with.projectFilesystem - filesystem.public Optional<Path> getPackagePathFromSource(Path sourcePath)
sourcePath - path to the java source file.public Optional<Path> getSourceRootFromSource(Path sourcePath)
sourcePath - path to the java source file.