Package gw.lang.reflect
Interface ITypeLoader
-
- All Superinterfaces:
IPluginHost
,IService
- All Known Subinterfaces:
IDefaultTypeLoader
,IExtendedTypeLoader
- All Known Implementing Classes:
DefaultTypeLoader
,DynamicTypeLoader
,GosuClassTypeLoader
,PackageTypeLoader
,PropertiesTypeLoader
,SimpleTypeLoader
,TypeInPackageTypeLoader
,TypeLoaderBase
public interface ITypeLoader extends IService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<String>
computeTypeNames()
Set<? extends CharSequence>
getAllNamespaces()
Don't call this method unless you really know what you're doing.Set<? extends CharSequence>
getAllTypeNames()
List<String>
getHandledPrefixes()
IModule
getModule()
String
getNamespaceForDirectory(IDirectory dir)
URL
getResource(String name)
Finds the resource with the given name.IType
getType(String fullyQualifiedName)
Gets a type based on a fully-qualified name.Set<TypeName>
getTypeNames(String namespace)
String[]
getTypesForFile(IFile file)
Returns ALL type names associated with the given file whether or not the types have been loaded yet.boolean
handlesDirectory(IDirectory dir)
boolean
handlesFile(IFile file)
boolean
handlesNonPrefixLoads()
boolean
hasNamespace(String namespace)
boolean
isCaseSensitive()
void
refreshed()
Fired when the typesystem is fully refreshedRefreshKind
refreshedFile(IFile file, String[] types, RefreshKind kind)
Notifies the type loader that a file has been refreshed.void
refreshedNamespace(String namespace, IDirectory dir, RefreshKind kind)
void
refreshedTypes(RefreshRequest request)
Fired when an existing type is refreshed, i.e. there are potential changesboolean
showTypeNamesInIDE()
void
shutdown()
-
Methods inherited from interface gw.plugin.IPluginHost
getInterface
-
-
-
-
Field Detail
-
NO_TYPES
static final String[] NO_TYPES
-
-
Method Detail
-
getModule
IModule getModule()
- Returns:
- The module to which this type loader belongs.
-
getType
IType getType(String fullyQualifiedName)
Gets a type based on a fully-qualified name. This could either be the name of an entity, like "entity.User", the name of a typekey, like "typekey.SystemPermission", or a class name, like "java.lang.String". Names can have [] appended to them to create arrays, and multi-dimensional arrays are supported.ClassNotFoundException
if none of its composite typeloaders can load the type.- Parameters:
fullyQualifiedName
- the fully qualified name of the type- Returns:
- the corresponding IType or null
-
getAllTypeNames
Set<? extends CharSequence> getAllTypeNames()
- Returns:
- the set of fully qualified type names this loader is responsible for loading. Note due to the dynamic nature of some type loaders, there is no guarantee that all types for a given loader are known at the time this method is called.
-
showTypeNamesInIDE
boolean showTypeNamesInIDE()
-
getAllNamespaces
Set<? extends CharSequence> getAllNamespaces()
Don't call this method unless you really know what you're doing.- Returns:
- the set of package (aka namespace) names in which this loader's types reside.
-
getResource
URL getResource(String name)
Finds the resource with the given name. A resource is some data that can be accessed by class code in a way that may be independent of the location of the code. The exact location of the resource is dependent upon the loader implementationThe name of a resource is a '/'-separated path name that identifies the resource.
- Parameters:
name
- The resource name- Returns:
- A URL object for reading the resource, or null if the resource could not be found or the invoker doesn't have adequate privileges to get the resource.
-
isCaseSensitive
boolean isCaseSensitive()
-
handlesNonPrefixLoads
boolean handlesNonPrefixLoads()
-
handlesFile
boolean handlesFile(IFile file)
-
getTypesForFile
String[] getTypesForFile(IFile file)
Returns ALL type names associated with the given file whether or not the types have been loaded yet. Type loading should NOT be used in the implementation of this method.- Parameters:
file
- The file in question- Returns:
- All known types derived from that file
-
refreshedFile
RefreshKind refreshedFile(IFile file, String[] types, RefreshKind kind)
Notifies the type loader that a file has been refreshed. The type loader should return all types that it knows need to be refreshed based on the given file.- Parameters:
file
- The file that was refreshedtypes
-kind
-- Returns:
- All known types affected by the file change
-
refreshedNamespace
void refreshedNamespace(String namespace, IDirectory dir, RefreshKind kind)
-
refreshedTypes
void refreshedTypes(RefreshRequest request)
Fired when an existing type is refreshed, i.e. there are potential changes- Parameters:
request
-
-
refreshed
void refreshed()
Fired when the typesystem is fully refreshed
-
handlesDirectory
boolean handlesDirectory(IDirectory dir)
-
getNamespaceForDirectory
String getNamespaceForDirectory(IDirectory dir)
-
hasNamespace
boolean hasNamespace(String namespace)
-
shutdown
void shutdown()
-
-