|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.roo.classpath.TypeLocationServiceImpl
@Service public class TypeLocationServiceImpl
Implementation of TypeLocationService.
For performance reasons automatically caches the queries. The cache is invalidated on changes to the file system.
| Constructor Summary | |
|---|---|
TypeLocationServiceImpl()
|
|
| Method Summary | |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext cContext)
|
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. |
org.springframework.roo.process.manager.FileManager |
getFileManager()
|
org.springframework.roo.file.monitor.FileMonitorService |
getFileMonitorService()
|
org.springframework.roo.metadata.MetadataService |
getMetadataService()
|
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 type)
Looks for the given JavaType within the user project, and if
found, returns the id for its PhysicalTypeMetadata. |
String |
getPhysicalTypeIdentifier(String fileCanonicalPath)
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)
|
org.springframework.roo.project.ProjectOperations |
getProjectOperations()
|
String |
getTopLevelPackageForModule(org.springframework.roo.project.maven.Pom module)
|
TypeCache |
getTypeCache()
|
ClassOrInterfaceTypeDetails |
getTypeDetails(org.springframework.roo.model.JavaType type)
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. |
TypeResolutionService |
getTypeResolutionService()
|
Collection<org.springframework.roo.model.JavaType> |
getTypesForModule(org.springframework.roo.project.maven.Pom module)
Returns the Java types that belong to the given module. |
Set<String> |
getTypesForModule(String modulePath)
Returns the Java types that belong to the given module. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TypeLocationServiceImpl()
| Method Detail |
|---|
protected void activate(org.osgi.service.component.ComponentContext cContext)
public Set<ClassOrInterfaceTypeDetails> findClassesOrInterfaceDetailsWithAnnotation(org.springframework.roo.model.JavaType... annotationsToDetect)
TypeLocationServiceClassOrInterfaceTypeDetailss that possess the
specified annotations (specified as a vararg).
findClassesOrInterfaceDetailsWithAnnotation in interface TypeLocationServiceannotationsToDetect - the annotations (as a vararg) to detect on a
type.
public Set<ClassOrInterfaceTypeDetails> findClassesOrInterfaceDetailsWithTag(Object tag)
TypeLocationServiceClassOrInterfaceTypeDetailss that possess the
specified tag.
findClassesOrInterfaceDetailsWithTag in interface TypeLocationServicetag - the tag to detect on a type.
public Set<org.springframework.roo.model.JavaType> findTypesWithAnnotation(org.springframework.roo.model.JavaType... annotationsToDetect)
TypeLocationServiceJavaTypes that possess the specified annotations
(specified as a vararg).
findTypesWithAnnotation in interface TypeLocationServiceannotationsToDetect - the annotations (as a vararg) to detect on a
type.
public Set<org.springframework.roo.model.JavaType> findTypesWithAnnotation(List<org.springframework.roo.model.JavaType> annotationsToDetect)
TypeLocationServiceJavaTypes that possess the specified list of
annotations.
findTypesWithAnnotation in interface TypeLocationServiceannotationsToDetect - the list of annotations to detect on a type.
public String getPhysicalTypeCanonicalPath(org.springframework.roo.model.JavaType javaType,
org.springframework.roo.project.LogicalPath path)
TypeLocationServiceJavaType would have
within the given LogicalPath; this type need not exist.
Equivalent to constructing the physical type id from the given arguments
and calling TypeLocationService.getPhysicalTypeCanonicalPath(String).
getPhysicalTypeCanonicalPath in interface TypeLocationServicejavaType - the type's JavaType (required)path - the type's logical path
public String getPhysicalTypeCanonicalPath(String physicalTypeId)
TypeLocationService
getPhysicalTypeCanonicalPath in interface TypeLocationServicephysicalTypeId - the physical type's metadata id (required)
public String getPhysicalTypeIdentifier(org.springframework.roo.model.JavaType type)
TypeLocationServiceJavaType 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).
getPhysicalTypeIdentifier in interface TypeLocationServicetype - the type to locate (required)
PhysicalTypeIdentifier format) if found,
or null if not foundpublic String getPhysicalTypeIdentifier(String fileCanonicalPath)
TypeLocationService
getPhysicalTypeIdentifier in interface TypeLocationServicefileCanonicalPath - the path to the physical type (required)
nullpublic List<String> getPotentialTopLevelPackagesForModule(org.springframework.roo.project.maven.Pom module)
getPotentialTopLevelPackagesForModule in interface TypeLocationServicepublic String getTopLevelPackageForModule(org.springframework.roo.project.maven.Pom module)
getTopLevelPackageForModule in interface TypeLocationServicepublic ClassOrInterfaceTypeDetails getTypeDetails(org.springframework.roo.model.JavaType type)
TypeLocationService
getTypeDetails in interface TypeLocationServicetype - the type to look for (required)
null if the type doesn't exist in the projectpublic ClassOrInterfaceTypeDetails getTypeDetails(String physicalTypeId)
TypeLocationServiceClassOrInterfaceTypeDetails 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.
getTypeDetails in interface TypeLocationServicephysicalTypeId - 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)public org.springframework.roo.project.LogicalPath getTypePath(org.springframework.roo.model.JavaType javaType)
TypeLocationServiceLogicalPath containing the given JavaType.
getTypePath in interface TypeLocationServicejavaType - the JavaType for which to return the
LogicalPath
null if that type doesn't exist in the projectpublic Collection<org.springframework.roo.model.JavaType> getTypesForModule(org.springframework.roo.project.maven.Pom module)
TypeLocationService
getTypesForModule in interface TypeLocationServicenull collectionpublic Set<String> getTypesForModule(String modulePath)
TypeLocationService
getTypesForModule in interface TypeLocationServicenull collection of fully-qualified type names
public boolean hasTypeChanged(String requestingClass,
org.springframework.roo.model.JavaType javaType)
TypeLocationService
hasTypeChanged in interface TypeLocationServicerequestingClass - the class requesting the changed typesjavaType - the type to lookup to see if a change has occurred
public boolean isInProject(org.springframework.roo.model.JavaType javaType)
TypeLocationService
isInProject in interface TypeLocationServicejavaType - the type to check for (can be null)
false if a null type is given
public void processTypesWithAnnotation(List<org.springframework.roo.model.JavaType> annotationsToDetect,
LocatedTypeCallback callback)
TypeLocationServicecallback implementation to process
the located types.
processTypesWithAnnotation in interface TypeLocationServiceannotationsToDetect - the list of annotations to detect on a type.callback - the LocatedTypeCallback to handle the processing
of the located typepublic org.springframework.roo.process.manager.FileManager getFileManager()
public org.springframework.roo.file.monitor.FileMonitorService getFileMonitorService()
public org.springframework.roo.metadata.MetadataService getMetadataService()
public org.springframework.roo.project.ProjectOperations getProjectOperations()
public TypeCache getTypeCache()
public TypeResolutionService getTypeResolutionService()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||