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 classstatic final classNested 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 IModuleprivate PackageToClassPathEntryTreeMapstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToMissCache(String strQualifiedClassName, String[] extensions) private voidaddToPackageCache(String fqn, IResource file) private voidaddTypeNames(IDirectory root, IDirectory path, Set<String> classNames, String[] fileExts) private booleanFinds 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 IFilefindFirstFile(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 PackageToClassPathEntryTreeMapgetCachedPackage(String fullyQualifiedName) private PackageToClassPathEntryTreeMapgetCachedPackageCorrectly(String fullyQualifiedName) private PackageToClassPathEntryTreeMapgetChildPackage(PackageToClassPathEntryTreeMap parent, String strRelativeName) getClassNameFromFile(IDirectory root, IFile file, String[] fileExts) private FqnCachegetMissCacheForExtension(String extension) The module having this repositoryprivate StringgetPackageName(String strQualifiedClassName) getTypeNames(String namespace, Set<String> extensions, ITypeLoader loader) Returns all type names in the given namespace and with the given extensions.inthasNamespace(String namespace) Returns the number of namespaces this repository has matching the given name.private booleaninMissCache(String strQualifiedClassName, String[] extensions) private static booleanisTestFolder(IDirectory file) private booleanprivate PackageToClassPathEntryTreeMapvoidnamespaceRefreshed(String namespace, IDirectory dir, RefreshKind kind) Called when a namespace is refreshedprivate voidprocessDirectory(PackageToClassPathEntryTreeMap node, IFileSystemGosuClassRepository.ClassPathEntry entry, IDirectory path) private voidremoveFromPackageCache(String fqn, IDirectory dir) private voidreset()voidsetExcludedPath(IDirectory[] excludedPath) voidsetSourcePath(IDirectory[] sourcePath) toString()voidtypesRefreshed(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:IGosuClassRepositoryThe module having this repository- Specified by:
getModulein interfaceIGosuClassRepository
-
getSourcePath
- Specified by:
getSourcePathin interfaceIFileSystemGosuClassRepository
-
setSourcePath
- Specified by:
setSourcePathin interfaceIFileSystemGosuClassRepository
-
getExcludedPath
- Specified by:
getExcludedPathin interfaceIFileSystemGosuClassRepository
-
setExcludedPath
- Specified by:
setExcludedPathin interfaceIFileSystemGosuClassRepository
-
findClass
Description copied from interface:IGosuClassRepositoryFinds the ISourceFileHandle for a given fully-qualified class name, or null if no such source file exists- Specified by:
findClassin 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:IGosuClassRepositoryFinds the given resource in this repository.The name of a resource is a '/'-separated path name that identifies the resource.
- Specified by:
findResourcein 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:
getAllTypeNamesin interfaceIGosuClassRepository- Returns:
- A set containing all type names in this repository (includes enhancement names)
-
getAllTypeNames
Description copied from interface:IGosuClassRepositoryReturns the names of all types in this repository that end with one of the specified file extensions- Specified by:
getAllTypeNamesin 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:
getClassNameFromFilein interfaceIFileSystemGosuClassRepository
-
typesRefreshed
Description copied from interface:IGosuClassRepositoryCalled when a type is refreshed- Specified by:
typesRefreshedin 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:IGosuClassRepositoryReturns all type names in the given namespace and with the given extensions.- Specified by:
getTypeNamesin interfaceIGosuClassRepository
-
hasNamespace
Description copied from interface:IGosuClassRepositoryReturns 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:
hasNamespacein interfaceIGosuClassRepository
-
namespaceRefreshed
Description copied from interface:IGosuClassRepositoryCalled when a namespace is refreshed- Specified by:
namespaceRefreshedin interfaceIGosuClassRepository
-
areDifferent
private boolean areDifferent(IDirectory[] cp1, List<IFileSystemGosuClassRepository.ClassPathEntry> cp2) -
isTestFolder
-
findFirstFile
- Specified by:
findFirstFilein interfaceIFileSystemGosuClassRepository
-
findFirstFile
-
toString
-