Package gw.internal.gosu.parser
Class FileSystemGosuClassRepository
java.lang.Object
gw.internal.gosu.parser.FileSystemGosuClassRepository
- All Implemented Interfaces:
IFileSystemGosuClassRepository
,IGosuClassRepository
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static final class
Nested classes/interfaces inherited from interface gw.lang.reflect.gs.IFileSystemGosuClassRepository
IFileSystemGosuClassRepository.ClassPathEntry, IFileSystemGosuClassRepository.IClassFileInfo, IFileSystemGosuClassRepository.Util
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Set<IDirectory>
private String[]
private final IModule
private PackageToClassPathEntryTreeMap
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addToMissCache
(String strQualifiedClassName, String[] extensions) private void
addToPackageCache
(String fqn, IResource file) private void
addTypeNames
(IDirectory root, IDirectory path, Set<String> classNames, String[] fileExts) private boolean
Finds the ISourceFileHandle for a given fully-qualified class name, or null if no such source file existsfindClassPathEntry
(IResource file) findFileInfoOnDisk
(String strQualifiedClassName, String[] extensions) findFirstFile
(String resourceName) private IFile
findFirstFile
(String resourceName, List<? extends IDirectory> searchPath) findResource
(String resourceName) Finds the given resource in this repository.getAllTypeNames
(String... extensions) Returns the names of all types in this repository that end with one of the specified file extensionsprivate PackageToClassPathEntryTreeMap
getCachedPackage
(String fullyQualifiedName) private PackageToClassPathEntryTreeMap
getCachedPackageCorrectly
(String fullyQualifiedName) private PackageToClassPathEntryTreeMap
getChildPackage
(PackageToClassPathEntryTreeMap parent, String strRelativeName) getClassNameFromFile
(IDirectory root, IFile file, String[] fileExts) private FqnCache
getMissCacheForExtension
(String extension) The module having this repositoryprivate String
getPackageName
(String strQualifiedClassName) getTypeNames
(String namespace, Set<String> extensions, ITypeLoader loader) Returns all type names in the given namespace and with the given extensions.int
hasNamespace
(String namespace) Returns the number of namespaces this repository has matching the given name.private boolean
inMissCache
(String strQualifiedClassName, String[] extensions) private static boolean
isTestFolder
(IDirectory file) private boolean
private PackageToClassPathEntryTreeMap
void
namespaceRefreshed
(String namespace, IDirectory dir, RefreshKind kind) Called when a namespace is refreshedprivate void
processDirectory
(PackageToClassPathEntryTreeMap node, IFileSystemGosuClassRepository.ClassPathEntry entry, IDirectory path) private void
removeFromPackageCache
(String fqn, IDirectory dir) private void
reset()
void
setExcludedPath
(IDirectory[] excludedPath) void
setSourcePath
(IDirectory[] sourcePath) toString()
void
typesRefreshed
(RefreshRequest request) Called when a type is refreshed
-
Field Details
-
_missCaches
-
RESOURCE_LOCATED_W_CLASSES
- See Also:
-
_module
-
_sourcePath
-
_excludedPath
-
_extensions
-
_rootNode
-
_allTypeNames
-
-
Constructor Details
-
FileSystemGosuClassRepository
-
-
Method Details
-
getModule
Description copied from interface:IGosuClassRepository
The module having this repository- Specified by:
getModule
in interfaceIGosuClassRepository
-
getSourcePath
- Specified by:
getSourcePath
in interfaceIFileSystemGosuClassRepository
-
setSourcePath
- Specified by:
setSourcePath
in interfaceIFileSystemGosuClassRepository
-
getExcludedPath
- Specified by:
getExcludedPath
in interfaceIFileSystemGosuClassRepository
-
setExcludedPath
- Specified by:
setExcludedPath
in interfaceIFileSystemGosuClassRepository
-
findClass
Description copied from interface:IGosuClassRepository
Finds the ISourceFileHandle for a given fully-qualified class name, or null if no such source file exists- Specified by:
findClass
in interfaceIGosuClassRepository
- Parameters:
strQualifiedClassName
- the fully-qualified name of the class- Returns:
- The source file handle for the given class, or null if no such source file exists.
-
findResource
Description copied from interface:IGosuClassRepository
Finds the given resource in this repository.The name of a resource is a '/'-separated path name that identifies the resource.
- Specified by:
findResource
in interfaceIGosuClassRepository
- Parameters:
resourceName
- the name of the resource- Returns:
- the URL of the resource or null if the resource cannot be found.
-
getAllTypeNames
- Specified by:
getAllTypeNames
in interfaceIGosuClassRepository
- Returns:
- A set containing all type names in this repository (includes enhancement names)
-
getAllTypeNames
Description copied from interface:IGosuClassRepository
Returns the names of all types in this repository that end with one of the specified file extensions- Specified by:
getAllTypeNames
in interfaceIGosuClassRepository
- Parameters:
extensions
- the set of file name extensions to consider- Returns:
- A set containing all the type names in this repository.
-
getClassNameFromFile
- Specified by:
getClassNameFromFile
in interfaceIFileSystemGosuClassRepository
-
typesRefreshed
Description copied from interface:IGosuClassRepository
Called when a type is refreshed- Specified by:
typesRefreshed
in interfaceIGosuClassRepository
-
reset
private void reset() -
addToPackageCache
-
findClassPathEntry
-
removeFromPackageCache
-
getCachedPackageCorrectly
-
getCachedPackage
-
getChildPackage
private PackageToClassPathEntryTreeMap getChildPackage(PackageToClassPathEntryTreeMap parent, String strRelativeName) -
loadPackageRoots
-
processDirectory
private void processDirectory(PackageToClassPathEntryTreeMap node, IFileSystemGosuClassRepository.ClassPathEntry entry, IDirectory path) -
isValidDirectory
-
findFileInfoOnDisk
private FileSystemGosuClassRepository.ClassFileInfo findFileInfoOnDisk(String strQualifiedClassName, String[] extensions) -
getPackageName
-
inMissCache
-
getMissCacheForExtension
-
addToMissCache
-
addTypeNames
private void addTypeNames(IDirectory root, IDirectory path, Set<String> classNames, String[] fileExts) -
getTypeNames
Description copied from interface:IGosuClassRepository
Returns all type names in the given namespace and with the given extensions.- Specified by:
getTypeNames
in interfaceIGosuClassRepository
-
hasNamespace
Description copied from interface:IGosuClassRepository
Returns the number of namespaces this repository has matching the given name. Note a namespace can span multiple source roots, hence the integer return value -- one per source root.- Specified by:
hasNamespace
in interfaceIGosuClassRepository
-
namespaceRefreshed
Description copied from interface:IGosuClassRepository
Called when a namespace is refreshed- Specified by:
namespaceRefreshed
in interfaceIGosuClassRepository
-
areDifferent
private boolean areDifferent(IDirectory[] cp1, List<IFileSystemGosuClassRepository.ClassPathEntry> cp2) -
isTestFolder
-
findFirstFile
- Specified by:
findFirstFile
in interfaceIFileSystemGosuClassRepository
-
findFirstFile
-
toString
-