Package gw.lang.reflect
Class TypeLoaderBase
java.lang.Object
gw.config.BaseService
gw.lang.reflect.TypeLoaderBase
- All Implemented Interfaces:
IService
,ITypeLoader
,IPluginHost
- Direct Known Subclasses:
DynamicTypeLoader
,PackageTypeLoader
,PropertiesTypeLoader
,SimpleTypeLoader
,TypeInPackageTypeLoader
-
Field Summary
FieldsFields inherited from interface gw.lang.reflect.ITypeLoader
NO_TYPES
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Deprecated.use TypeLoaderBase( IModule )protected
TypeLoaderBase
(IModule module) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
private String
getId()
getResource
(String name) Finds the resource with the given name.getTypeNames
(String namespace) getTypeNames
(String parentNamespace, ITypeLoader loader) String[]
getTypesForFile
(IFile file) Returns ALL type names associated with the given file whether or not the types have been loaded yet.boolean
boolean
handlesFile
(IFile file) boolean
final void
Fired when the typesystem is fully refreshedrefreshedFile
(IFile file, String[] types, RefreshKind kind) Notifies the type loader that a file has been refreshed.protected void
final void
refreshedTypes
(RefreshRequest request) Fired when an existing type is refreshed, i.e.protected void
refreshedTypesImpl
(RefreshRequest request) void
protected boolean
boolean
void
shutdown()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface gw.plugin.IPluginHost
getInterface
Methods inherited from interface gw.lang.reflect.ITypeLoader
computeTypeNames, getAllNamespaces, getHandledPrefixes, getType, handlesNonPrefixLoads, hasNamespace, refreshedNamespace
-
Field Details
-
_module
-
_typeNames
-
-
Constructor Details
-
TypeLoaderBase
protected TypeLoaderBase()Deprecated.use TypeLoaderBase( IModule ) -
TypeLoaderBase
-
-
Method Details
-
getModule
- Specified by:
getModule
in interfaceITypeLoader
- Returns:
- The module to which this type loader belongs.
-
isCaseSensitive
public boolean isCaseSensitive()- Specified by:
isCaseSensitive
in interfaceITypeLoader
-
handlesFile
- Specified by:
handlesFile
in interfaceITypeLoader
-
handlesDirectory
- Specified by:
handlesDirectory
in interfaceITypeLoader
-
getNamespaceForDirectory
- Specified by:
getNamespaceForDirectory
in interfaceITypeLoader
-
getTypesForFile
Description copied from interface:ITypeLoader
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.- Specified by:
getTypesForFile
in interfaceITypeLoader
- Parameters:
file
- The file in question- Returns:
- All known types derived from that file
-
refreshedFile
Description copied from interface:ITypeLoader
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.- Specified by:
refreshedFile
in interfaceITypeLoader
- Parameters:
file
- The file that was refreshed- Returns:
- All known types affected by the file change
-
getResource
Description copied from interface:ITypeLoader
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.
- Specified by:
getResource
in interfaceITypeLoader
- 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.
-
refreshedTypes
Description copied from interface:ITypeLoader
Fired when an existing type is refreshed, i.e. there are potential changes- Specified by:
refreshedTypes
in interfaceITypeLoader
-
refreshedTypesImpl
-
refreshed
public final void refreshed()Description copied from interface:ITypeLoader
Fired when the typesystem is fully refreshed- Specified by:
refreshed
in interfaceITypeLoader
-
clearTypeNames
protected void clearTypeNames() -
refreshedImpl
protected void refreshedImpl() -
toString
-
getTypeNames
- Specified by:
getTypeNames
in interfaceITypeLoader
-
getTypeNames
-
showTypeNamesInIDE
public boolean showTypeNamesInIDE()- Specified by:
showTypeNamesInIDE
in interfaceITypeLoader
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceITypeLoader
-
getId
-
deleteIndexFile
protected void deleteIndexFile() -
saveTypeNames
public void saveTypeNames() -
loadTypeNames
-
getAllTypeNames
- Specified by:
getAllTypeNames
in interfaceITypeLoader
- 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.
-
shouldCacheTypeNames
protected boolean shouldCacheTypeNames()
-