Class ModelLoaders<M extends IModel>

  • Type Parameters:
    M - the specific type of model

    public class ModelLoaders<M extends IModel>
    extends java.lang.Object
    Manages the model loaders. This class is not intended to be instantiated directly rather than being created from ModelManagement.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ModelLoaders

        ModelLoaders​(IModelManagementRepository<M> repository)
        Prevents this class from being instantiated from outside this package.
        Parameters:
        repository - the model management repository for callbacks
    • Method Detail

      • scanAll

        void scanAll​(java.io.File location,
                     ModelInfoHolder<M> holder)
        Scans all locations for model information objects.
        Parameters:
        location - the location to scan
        holder - the combined information and result collection instance
      • isRegistered

        public boolean isRegistered​(IModelLoader<M> loader)
        Returns whether the given loader is already registered.
        Parameters:
        loader - the loader to check for
        Returns:
        true if the loader is registered, false else
      • unregisterLoader

        public void unregisterLoader​(IModelLoader<M> loader,
                                     ProgressObserver observer)
        Unregisters a model loader.
        Parameters:
        loader - the model loader
        observer - an optional progress observer (use ProgressObserver.NO_OBSERVER but not null in case that no observation is intended)
      • getLoaderCount

        public int getLoaderCount()
        Returns the number of loaders configured.
        Returns:
        the number of loaders
      • getDefaultLoader

        public IModelLoader<M> getDefaultLoader()
        Returns the default loader. This shall be used in case that a model information (for some reason) does not declear a specific loader.
        Returns:
        the default loader (may be null if there is none)