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

public abstract class TypeLoaderBase extends BaseService implements ITypeLoader
  • Field Details

    • _module

      protected IModule _module
    • _typeNames

      protected Set<String> _typeNames
  • Constructor Details

    • TypeLoaderBase

      protected TypeLoaderBase()
      Deprecated.
      use TypeLoaderBase( IModule )
    • TypeLoaderBase

      protected TypeLoaderBase(IModule module)
  • Method Details

    • getModule

      public IModule getModule()
      Specified by:
      getModule in interface ITypeLoader
      Returns:
      The module to which this type loader belongs.
    • isCaseSensitive

      public boolean isCaseSensitive()
      Specified by:
      isCaseSensitive in interface ITypeLoader
    • handlesFile

      public boolean handlesFile(IFile file)
      Specified by:
      handlesFile in interface ITypeLoader
    • handlesDirectory

      public boolean handlesDirectory(IDirectory dir)
      Specified by:
      handlesDirectory in interface ITypeLoader
    • getNamespaceForDirectory

      public String getNamespaceForDirectory(IDirectory dir)
      Specified by:
      getNamespaceForDirectory in interface ITypeLoader
    • getTypesForFile

      public String[] getTypesForFile(IFile file)
      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 interface ITypeLoader
      Parameters:
      file - The file in question
      Returns:
      All known types derived from that file
    • refreshedFile

      public RefreshKind refreshedFile(IFile file, String[] types, RefreshKind kind)
      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 interface ITypeLoader
      Parameters:
      file - The file that was refreshed
      Returns:
      All known types affected by the file change
    • getResource

      public URL getResource(String name)
      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 implementation

      The name of a resource is a '/'-separated path name that identifies the resource.

      Specified by:
      getResource in interface ITypeLoader
      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

      public final void refreshedTypes(RefreshRequest request)
      Description copied from interface: ITypeLoader
      Fired when an existing type is refreshed, i.e. there are potential changes
      Specified by:
      refreshedTypes in interface ITypeLoader
    • refreshedTypesImpl

      protected void refreshedTypesImpl(RefreshRequest request)
    • refreshed

      public final void refreshed()
      Description copied from interface: ITypeLoader
      Fired when the typesystem is fully refreshed
      Specified by:
      refreshed in interface ITypeLoader
    • clearTypeNames

      protected void clearTypeNames()
    • refreshedImpl

      protected void refreshedImpl()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTypeNames

      public Set<TypeName> getTypeNames(String namespace)
      Specified by:
      getTypeNames in interface ITypeLoader
    • getTypeNames

      public static Set<TypeName> getTypeNames(String parentNamespace, ITypeLoader loader)
    • showTypeNamesInIDE

      public boolean showTypeNamesInIDE()
      Specified by:
      showTypeNamesInIDE in interface ITypeLoader
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface ITypeLoader
    • getId

      private String getId()
    • deleteIndexFile

      protected void deleteIndexFile()
    • saveTypeNames

      public void saveTypeNames()
    • loadTypeNames

      public Set<String> loadTypeNames()
    • getAllTypeNames

      public final Set<String> getAllTypeNames()
      Specified by:
      getAllTypeNames in interface ITypeLoader
      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()