@Service
@Reference(name="pathResolvingStrategy",
strategy=EVENT,
policy=DYNAMIC,
referenceInterface=PathResolvingStrategy.class,
cardinality=OPTIONAL_MULTIPLE)
public class DelegatePathResolver
extends Object
implements PathResolver
PathResolver implementation.
Subclasses should be created for common build system structures.
| Constructor and Description |
|---|
DelegatePathResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindPathResolvingStrategy(PathResolvingStrategy strategy) |
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 moduleName,
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. |
protected void |
unbindPathResolvingStrategy(PathResolvingStrategy strategy) |
protected void bindPathResolvingStrategy(PathResolvingStrategy strategy)
public String getCanonicalPath(LogicalPath path, org.springframework.roo.model.JavaType javaType)
PathResolverJavaType within the given
LogicalPathgetCanonicalPath in interface PathResolverpath - the path to the type's base package (required)javaType - the type for which to get the path (required)public String getCanonicalPath(String moduleName, Path path, org.springframework.roo.model.JavaType javaType)
PathResolverJavaType in the given
Path of the module.getCanonicalPath in interface PathResolverpublic String getFocusedCanonicalPath(Path path, org.springframework.roo.model.JavaType javaType)
PathResolverJavaType in the given
Path of the currently focused module.getFocusedCanonicalPath in interface PathResolverpublic String getFocusedIdentifier(Path path, String relativePath)
PathResolverPath of the currently focused module.getFocusedIdentifier in interface PathResolverpublic LogicalPath getFocusedPath(Path path)
PathResolverLogicalPath for the given Path within the
currently focused module.getFocusedPath in interface PathResolverpath - the path within the currently focused module (required)null instancepublic String getFocusedRoot(Path path)
getFocusedRoot in interface PathResolverpublic String getFriendlyName(String identifier)
PathResolvergetFriendlyName in interface PathResolveridentifier - to resolve (required)public String getIdentifier(String moduleName, Path path, String relativePath)
PathResolverPath of the specified module.getIdentifier in interface PathResolverpublic String getIdentifier(LogicalPath path, String relativePath)
PathResolverPath and relative
path.getIdentifier in interface PathResolverpath - to use (required)relativePath - to use (cannot be null, but may be empty if referring
to the path itself)public LogicalPath getPath(String moduleName, Path path)
PathResolverLogicalPath for the given Path within the
specified module.getPath in interface PathResolverpath - the path within the specified module (required)null instancepublic LogicalPath getPath(String identifier)
PathResolverPath the specified canonical path
falls under.getPath in interface PathResolveridentifier - to lookup (required)Path, or null if the identifier refers to a location
not under a know path.public Collection<LogicalPath> getPaths()
PathResolvergetPaths in interface PathResolvernull listpublic String getRelativeSegment(String identifier)
PathResolverPath the specified canonical path
falls under, and then returns the relative portion of the file name.
See FileDetails.getRelativeSegment(String) for related
information.
getRelativeSegment in interface PathResolveridentifier - to resolve (required)Path directly), or null if the
identifier does not have a corresponding Pathpublic String getRoot()
PathResolvergetRoot in interface PathResolverpublic String getRoot(LogicalPath path)
PathResolverLogicalPath.getRoot in interface PathResolverpath - to lookup (required)null if the root path cannot be determinedpublic Collection<LogicalPath> getSourcePaths()
PathResolverLogicalPaths of user project directories that can
contain Java source code.getSourcePaths in interface PathResolvernull listprotected void unbindPathResolvingStrategy(PathResolvingStrategy strategy)
Copyright © 2009–2017 Pivotal Software, Inc.. All rights reserved.