Class ModelLoaders<M extends IModel>

java.lang.Object
net.ssehub.easy.basics.modelManagement.ModelLoaders<M>
Type Parameters:
M - the specific type of model

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

  • Constructor Details

    • ModelLoaders

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

    • scanAll

      void scanAll(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
    • registerLoader

      public void registerLoader(IModelLoader<M> loader, ProgressObserver observer) throws ModelManagementException
      Registers a model loader and updates the model information provided by the 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)
      Throws:
      ModelManagementException - in case that the loader aims at loading inconsistent information
    • 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)