public interface PathResolver
File, Path and canonical path
Strings.
Add-ons should use this class as their primary mechanism to resolve paths in
order to maximize future compatibility with any design refactoring, project
structural enhancements or alternate build systems. Add-ons should generally
avoid using File directly.
| Modifier and Type | Method and Description |
|---|---|
String |
getCanonicalPath(LogicalPath path,
org.springframework.roo.model.JavaType javaType)
Returns the canonical path to the given
JavaType within the given
LogicalPath |
String |
getCanonicalPath(String moduleName,
Path path,
org.springframework.roo.model.JavaType javaType)
Returns the canonical path of the given
JavaType in the given
Path of the module. |
String |
getFocusedCanonicalPath(Path path,
org.springframework.roo.model.JavaType javaType)
Returns the canonical path of the given
JavaType in the given
Path of the currently focused module. |
String |
getFocusedIdentifier(Path path,
String relativePath)
Returns the canonical path of the given path relative to the given
Path of the currently focused module. |
LogicalPath |
getFocusedPath(Path path)
Returns the
LogicalPath for the given Path within the
currently focused module. |
String |
getFocusedRoot(Path path) |
String |
getFriendlyName(String identifier)
Converts the presented canonical path into a human-friendly name.
|
String |
getIdentifier(LogicalPath path,
String relativePath)
Produces a canonical path for the presented
Path and relative
path. |
String |
getIdentifier(String moduleName,
Path path,
String relativePath)
Returns the canonical path of the given path relative to the given
Path of the specified module. |
LogicalPath |
getPath(String identifier)
Attempts to determine which
Path the specified canonical path
falls under. |
LogicalPath |
getPath(String modelName,
Path path)
Returns the
LogicalPath for the given Path within the
specified module. |
Collection<LogicalPath> |
getPaths()
Returns all known paths within the user project.
|
String |
getRelativeSegment(String identifier)
Attempts to determine which
Path the specified canonical path
falls under, and then returns the relative portion of the file name. |
String |
getRoot()
Returns the canonical path of the user project's root directory
|
String |
getRoot(LogicalPath path)
Returns the canonical path of the root of the given
LogicalPath. |
Collection<LogicalPath> |
getSourcePaths()
Returns the
LogicalPaths of user project directories that can
contain Java source code. |
String getCanonicalPath(LogicalPath path, org.springframework.roo.model.JavaType javaType)
JavaType within the given
LogicalPathpath - the path to the type's base package (required)javaType - the type for which to get the path (required)String getCanonicalPath(String moduleName, Path path, org.springframework.roo.model.JavaType javaType)
JavaType in the given
Path of the module.moduleName - path - javaType - String getFocusedCanonicalPath(Path path, org.springframework.roo.model.JavaType javaType)
JavaType in the given
Path of the currently focused module.path - javaType - String getFocusedIdentifier(Path path, String relativePath)
Path of the currently focused module.path - relativePath - LogicalPath getFocusedPath(Path path)
LogicalPath for the given Path within the
currently focused module.path - the path within the currently focused module (required)null instanceString getFriendlyName(String identifier)
identifier - to resolve (required)String getIdentifier(LogicalPath path, String relativePath)
Path and relative
path.path - to use (required)relativePath - to use (cannot be null, but may be empty if referring
to the path itself)String getIdentifier(String moduleName, Path path, String relativePath)
Path of the specified module.moduleName - path - relativePath - LogicalPath getPath(String identifier)
Path the specified canonical path
falls under.identifier - to lookup (required)Path, or null if the identifier refers to a location
not under a know path.LogicalPath getPath(String modelName, Path path)
LogicalPath for the given Path within the
specified module.moduleName - the specified module (required)path - the path within the specified module (required)null instanceCollection<LogicalPath> getPaths()
null listString getRelativeSegment(String identifier)
Path the specified canonical path
falls under, and then returns the relative portion of the file name.
See FileDetails.getRelativeSegment(String) for related
information.
String getRoot()
String getRoot(LogicalPath path)
LogicalPath.path - to lookup (required)null if the root path cannot be determinedCollection<LogicalPath> getSourcePaths()
LogicalPaths of user project directories that can
contain Java source code.null listCopyright © 2009–2017 Pivotal Software, Inc.. All rights reserved.