public interface TypeLocationService
| Modifier and Type | Method and Description |
|---|---|
void |
addDependencies(ModuleFeatureName moduleFeatureName,
Collection<? extends org.springframework.roo.project.Dependency> dependencies)
Attempts to add the specified dependencies into modules that have installed a module feature.
|
void |
addModuleDependency(String module,
org.springframework.roo.model.JavaType moduleJavaType)
Adds to the given module the dependency with the module that contains the java type.
|
Set<ClassOrInterfaceTypeDetails> |
findClassesOrInterfaceDetailsWithAnnotation(org.springframework.roo.model.JavaType... annotationsToDetect)
Returns a set of
ClassOrInterfaceTypeDetailss that possess the
specified annotations (specified as a vararg). |
Set<ClassOrInterfaceTypeDetails> |
findClassesOrInterfaceDetailsWithTag(Object tag)
Returns a set of
ClassOrInterfaceTypeDetailss that possess the
specified tag. |
Set<org.springframework.roo.model.JavaType> |
findTypesWithAnnotation(org.springframework.roo.model.JavaType... annotationsToDetect)
Returns a set of
JavaTypes that possess the specified annotations
(specified as a vararg). |
Set<org.springframework.roo.model.JavaType> |
findTypesWithAnnotation(List<org.springframework.roo.model.JavaType> annotationsToDetect)
Returns a set of
JavaTypes that possess the specified list of
annotations. |
Collection<String> |
getModuleNames(ModuleFeatureName moduleFeatureName)
Returns the list of module names that have installed a module feature.
|
Collection<org.springframework.roo.project.maven.Pom> |
getModules(ModuleFeatureName moduleFeatureName)
Returns the modules that have installed a module feature.
|
List<org.springframework.roo.model.JavaPackage> |
getPackagesForModule(org.springframework.roo.project.maven.Pom module)
Returns a list with all JavaPackages for a given module.
|
List<org.springframework.roo.model.JavaPackage> |
getPackagesForModule(String moduleName)
Returns a list with all JavaPackages for a given module.
|
String |
getPhysicalTypeCanonicalPath(org.springframework.roo.model.JavaType javaType,
org.springframework.roo.project.LogicalPath path)
Returns the canonical path that the given
JavaType would have
within the given LogicalPath; this type need not exist. |
String |
getPhysicalTypeCanonicalPath(String physicalTypeId)
Returns the canonical path that a type with the given physical type id
would have; this type need not exist.
|
String |
getPhysicalTypeIdentifier(org.springframework.roo.model.JavaType javaType)
Looks for the given
JavaType within the user project, and if
found, returns the id for its PhysicalTypeMetadata. |
String |
getPhysicalTypeIdentifier(String fileIdentifier)
Returns the physical type identifier for the Java source file with the
given canonical path.
|
List<String> |
getPotentialTopLevelPackagesForModule(org.springframework.roo.project.maven.Pom module) |
String |
getTopLevelPackageForModule(org.springframework.roo.project.maven.Pom module) |
ClassOrInterfaceTypeDetails |
getTypeDetails(org.springframework.roo.model.JavaType javaType)
Returns the details of the given Java type from within the user project.
|
ClassOrInterfaceTypeDetails |
getTypeDetails(String physicalTypeId)
Resolves the
ClassOrInterfaceTypeDetails to for the provided
physical type identifier. |
org.springframework.roo.project.LogicalPath |
getTypePath(org.springframework.roo.model.JavaType javaType)
Returns the
LogicalPath containing the given JavaType. |
Collection<org.springframework.roo.model.JavaType> |
getTypesForModule(org.springframework.roo.project.maven.Pom module)
Returns the Java types that belong to the given module.
|
Collection<String> |
getTypesForModule(String modulePath)
Deprecated.
use
getTypesForModule(Pom) instead; more strongly
typed and also ignores any types found in pom-packaged
modules |
boolean |
hasModuleFeature(org.springframework.roo.project.maven.Pom module,
ModuleFeatureName moduleFeatureName)
Indicates whether the specified module in has installed the module feature.
|
boolean |
hasTypeChanged(String requestingClass,
org.springframework.roo.model.JavaType javaType)
Indicates whether the passed in type has changed since last invocation by
the requesting class.
|
boolean |
isInProject(org.springframework.roo.model.JavaType javaType)
Indicates whether the given type exists anywhere in the user project
|
void |
processTypesWithAnnotation(List<org.springframework.roo.model.JavaType> annotationsToDetect,
LocatedTypeCallback callback)
Processes types with the specified list of annotations and uses the
supplied
callback implementation to process
the located types. |
void |
removeDependencies(ModuleFeatureName moduleFeatureName,
Collection<? extends org.springframework.roo.project.Dependency> dependencies)
Attempts to remove the specified dependencies from modules that have installed a module feature.
|
void addDependencies(ModuleFeatureName moduleFeatureName, Collection<? extends org.springframework.roo.project.Dependency> dependencies)
ProjectMetadata#isDependencyRegistered(org.springframework.roo.project.Dependency)
, the method silently returns. Otherwise the dependency is added.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
moduleFeatureName - the module feature (required)dependencies - the dependencies to add (required)void addModuleDependency(String module, org.springframework.roo.model.JavaType moduleJavaType)
moduleName - the name of the module where to install the dependency (required)moduleJavaType - the java type that belongs to the module to act uponvoid removeDependencies(ModuleFeatureName moduleFeatureName, Collection<? extends org.springframework.roo.project.Dependency> dependencies)
ProjectMetadata#isDependencyRegistered(Dependency), the method
silently returns. Otherwise each located dependency is removed.
An exception is thrown if this method is called before there is
ProjectMetadata available, or if the on-disk representation
cannot be modified for any reason.
moduleFeatureName - the module feature (required)dependencies - the dependencies to remove (required)Set<ClassOrInterfaceTypeDetails> findClassesOrInterfaceDetailsWithAnnotation(org.springframework.roo.model.JavaType... annotationsToDetect)
ClassOrInterfaceTypeDetailss that possess the
specified annotations (specified as a vararg).annotationsToDetect - the annotations (as a vararg) to detect on a
type.Set<ClassOrInterfaceTypeDetails> findClassesOrInterfaceDetailsWithTag(Object tag)
ClassOrInterfaceTypeDetailss that possess the
specified tag.tag - the tag to detect on a type.Set<org.springframework.roo.model.JavaType> findTypesWithAnnotation(org.springframework.roo.model.JavaType... annotationsToDetect)
JavaTypes that possess the specified annotations
(specified as a vararg).annotationsToDetect - the annotations (as a vararg) to detect on a
type.Set<org.springframework.roo.model.JavaType> findTypesWithAnnotation(List<org.springframework.roo.model.JavaType> annotationsToDetect)
JavaTypes that possess the specified list of
annotations.annotationsToDetect - the list of annotations to detect on a type.List<org.springframework.roo.model.JavaPackage> getPackagesForModule(org.springframework.roo.project.maven.Pom module)
module - the Pom of the module to search for.List<org.springframework.roo.model.JavaPackage> getPackagesForModule(String moduleName)
module - the String with the module name to search for.String getPhysicalTypeCanonicalPath(org.springframework.roo.model.JavaType javaType, org.springframework.roo.project.LogicalPath path)
JavaType would have
within the given LogicalPath; this type need not exist.
Equivalent to constructing the physical type id from the given arguments
and calling getPhysicalTypeCanonicalPath(String).
javaType - the type's JavaType (required)path - the type's logical pathString getPhysicalTypeCanonicalPath(String physicalTypeId)
physicalTypeId - the physical type's metadata id (required)String getPhysicalTypeIdentifier(org.springframework.roo.model.JavaType javaType)
JavaType within the user project, and if
found, returns the id for its PhysicalTypeMetadata. Use this
method if you know that the JavaType exists but don't know its
LogicalPath.
This method resolves the issue that a JavaType is location
independent, yet PhysicalTypeIdentifier instances are location
dependent (i.e. a PhysicalTypeIdentifier relates to a given
physical file, whereas a JavaType simply represents a type on the
classpath).
javaType - the type to locate (required)PhysicalTypeIdentifier format) if found,
or null if not foundString getPhysicalTypeIdentifier(String fileIdentifier)
fileIdentifier - the path to the physical type (required)nullList<String> getPotentialTopLevelPackagesForModule(org.springframework.roo.project.maven.Pom module)
module - String getTopLevelPackageForModule(org.springframework.roo.project.maven.Pom module)
module - Collection<org.springframework.roo.project.maven.Pom> getModules(ModuleFeatureName moduleFeatureName)
moduleFeatureName - the module feature (required)null collectionCollection<String> getModuleNames(ModuleFeatureName moduleFeatureName)
moduleFeatureName - the module feature (required)null collectionClassOrInterfaceTypeDetails getTypeDetails(org.springframework.roo.model.JavaType javaType)
javaType - the type to look for (required)null if the type doesn't exist in the projectClassOrInterfaceTypeDetails getTypeDetails(String physicalTypeId)
ClassOrInterfaceTypeDetails to for the provided
physical type identifier. If the physical type identifier doesn't
represent a valid type an exception is thrown. This method will return
null if the ClassOrInterfaceTypeDetails can't be found.physicalTypeId - the physical type metadata id (can be blank)ClassOrInterfaceTypeDetails, or
null if the details can't be found (e.g. the given
ID is blank)org.springframework.roo.project.LogicalPath getTypePath(org.springframework.roo.model.JavaType javaType)
LogicalPath containing the given JavaType.javaType - the JavaType for which to return the
LogicalPathnull if that type doesn't exist in the projectCollection<org.springframework.roo.model.JavaType> getTypesForModule(org.springframework.roo.project.maven.Pom module)
module - null collection@Deprecated Collection<String> getTypesForModule(String modulePath)
getTypesForModule(Pom) instead; more strongly
typed and also ignores any types found in pom-packaged
modulesmodulePath - null collection of fully-qualified type namesboolean hasTypeChanged(String requestingClass, org.springframework.roo.model.JavaType javaType)
requestingClass - the class requesting the changed typesjavaType - the type to lookup to see if a change has occurredboolean hasModuleFeature(org.springframework.roo.project.maven.Pom module,
ModuleFeatureName moduleFeatureName)
module - the module to inspect its installed features (required)moduleFeatureName - the module feature (required)boolean isInProject(org.springframework.roo.model.JavaType javaType)
javaType - the type to check for (can be null)false if a null type is givenvoid processTypesWithAnnotation(List<org.springframework.roo.model.JavaType> annotationsToDetect, LocatedTypeCallback callback)
callback implementation to process
the located types.annotationsToDetect - the list of annotations to detect on a type.callback - the LocatedTypeCallback to handle the processing
of the located typeCopyright © 2009–2017. All rights reserved.