Package gw.internal.gosu.parser
Class FileSystemGosuClassRepository
- java.lang.Object
-
- gw.internal.gosu.parser.FileSystemGosuClassRepository
-
- All Implemented Interfaces:
IFileSystemGosuClassRepository
,IGosuClassRepository
public class FileSystemGosuClassRepository extends Object implements IFileSystemGosuClassRepository
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileSystemGosuClassRepository.ClassFileInfo
static class
FileSystemGosuClassRepository.FileSystemSourceFileHandle
-
Nested classes/interfaces inherited from interface gw.lang.reflect.gs.IFileSystemGosuClassRepository
IFileSystemGosuClassRepository.ClassPathEntry, IFileSystemGosuClassRepository.IClassFileInfo, IFileSystemGosuClassRepository.Util
-
-
Field Summary
Fields Modifier and Type Field Description static String
RESOURCE_LOCATED_W_CLASSES
-
Constructor Summary
Constructors Constructor Description FileSystemGosuClassRepository(IModule module)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ISourceFileHandle
findClass(String strQualifiedClassName, String[] extensions)
Finds the ISourceFileHandle for a given fully-qualified class name, or null if no such source file existsIFile
findFirstFile(String resourceName)
URL
findResource(String resourceName)
Finds the given resource in this repository.Set<String>
getAllTypeNames()
Set<String>
getAllTypeNames(String... extensions)
Returns the names of all types in this repository that end with one of the specified file extensionsString
getClassNameFromFile(IDirectory root, IFile file, String[] fileExts)
IDirectory[]
getExcludedPath()
IModule
getModule()
The module having this repositoryIDirectory[]
getSourcePath()
Set<TypeName>
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.void
namespaceRefreshed(String namespace, IDirectory dir, RefreshKind kind)
Called when a namespace is refreshedvoid
setExcludedPath(IDirectory[] excludedPath)
void
setSourcePath(IDirectory[] sourcePath)
String
toString()
void
typesRefreshed(RefreshRequest request)
Called when a type is refreshed
-
-
-
Field Detail
-
RESOURCE_LOCATED_W_CLASSES
public static final String RESOURCE_LOCATED_W_CLASSES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileSystemGosuClassRepository
public FileSystemGosuClassRepository(IModule module)
-
-
Method Detail
-
getModule
public IModule getModule()
Description copied from interface:IGosuClassRepository
The module having this repository- Specified by:
getModule
in interfaceIGosuClassRepository
-
getSourcePath
public IDirectory[] getSourcePath()
- Specified by:
getSourcePath
in interfaceIFileSystemGosuClassRepository
-
setSourcePath
public void setSourcePath(IDirectory[] sourcePath)
- Specified by:
setSourcePath
in interfaceIFileSystemGosuClassRepository
-
getExcludedPath
public IDirectory[] getExcludedPath()
- Specified by:
getExcludedPath
in interfaceIFileSystemGosuClassRepository
-
setExcludedPath
public void setExcludedPath(IDirectory[] excludedPath)
- Specified by:
setExcludedPath
in interfaceIFileSystemGosuClassRepository
-
findClass
public ISourceFileHandle findClass(String strQualifiedClassName, String[] extensions)
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
public URL findResource(String resourceName)
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
public Set<String> getAllTypeNames()
- Specified by:
getAllTypeNames
in interfaceIGosuClassRepository
- Returns:
- A set containing all type names in this repository (includes enhancement names)
-
getAllTypeNames
public Set<String> getAllTypeNames(String... extensions)
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
public String getClassNameFromFile(IDirectory root, IFile file, String[] fileExts)
- Specified by:
getClassNameFromFile
in interfaceIFileSystemGosuClassRepository
-
typesRefreshed
public void typesRefreshed(RefreshRequest request)
Description copied from interface:IGosuClassRepository
Called when a type is refreshed- Specified by:
typesRefreshed
in interfaceIGosuClassRepository
-
getTypeNames
public Set<TypeName> getTypeNames(String namespace, Set<String> extensions, ITypeLoader loader)
Description copied from interface:IGosuClassRepository
Returns all type names in the given namespace and with the given extensions.- Specified by:
getTypeNames
in interfaceIGosuClassRepository
-
hasNamespace
public int hasNamespace(String namespace)
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
public void namespaceRefreshed(String namespace, IDirectory dir, RefreshKind kind)
Description copied from interface:IGosuClassRepository
Called when a namespace is refreshed- Specified by:
namespaceRefreshed
in interfaceIGosuClassRepository
-
findFirstFile
public IFile findFirstFile(String resourceName)
- Specified by:
findFirstFile
in interfaceIFileSystemGosuClassRepository
-
-