Interface ModelRepository


@NonNullByDefault public interface ModelRepository
The model repository stores the configuration files (EMF models). It takes care of loading these resources and serving them to clients. By this abstraction, the clients do not need to know where the models come from.
Author:
Kai Kreuzer - Initial contribution
  • Method Details

    • getModel

      @Nullable org.eclipse.emf.ecore.EObject getModel(String name)
      Returns a model of a given name
      Parameters:
      name - name of the requested model
      Returns:
      the model or null, if not found
    • addOrRefreshModel

      boolean addOrRefreshModel(String name, InputStream inputStream)
      Adds a model to the repository or refreshes it if it already exists
      Parameters:
      name - the model name to add/refresh
      inputStream - an input stream with the model's content, optional if the file already exists
      Returns:
      true, if it was successfully processed, false otherwise
    • removeModel

      boolean removeModel(String name)
      Removes a model from the repository
      Parameters:
      name - the name of the model to remove
      Returns:
      true, if model was removed, false, if it did not exist
    • getAllModelNamesOfType

      Iterable<String> getAllModelNamesOfType(String modelType)
      Returns all names of models of a given type (file extension)
      Parameters:
      modelType - the model type to get the names for
      Returns:
      all names of available models
    • reloadAllModelsOfType

      void reloadAllModelsOfType(String modelType)
      Reload and parse all models of the given type
      Parameters:
      modelType - the model type to reload
    • removeAllModelsOfType

      Set<String> removeAllModelsOfType(String modelType)
      Remove all models of the given type
      Parameters:
      modelType - the model type to remove
      Returns:
      all names of the removed models
    • addModelRepositoryChangeListener

      void addModelRepositoryChangeListener(ModelRepositoryChangeListener listener)
      Adds a change listener
      Parameters:
      listener - the listener to add
    • removeModelRepositoryChangeListener

      void removeModelRepositoryChangeListener(ModelRepositoryChangeListener listener)
      Removes a change listener
      Parameters:
      listener - the listener to remove