Interface IModelRepository<M extends IModel>

Type Parameters:
M - the specific type of model
All Known Implementing Classes:
ModelRepository

public interface IModelRepository<M extends IModel>
Defines the interface of a model repository.
Author:
Holger Eichelberger
  • Method Details

    • getAvailable

      List<VersionedModelInfos<M>> getAvailable(String name)
      Returns models available for a given model name.
      Parameters:
      name - the name to search for
      Returns:
      the available model or null
    • getDefaultLibraryLocations

      List<ModelLocations.Location> getDefaultLibraryLocations()
      Returns the default library locations.
      Returns:
      the default library locations
    • isOutdated

      boolean isOutdated(ModelInfo<M> info)
      Returns whether a model information is outdated.
      Parameters:
      info - the object to be tested
      Returns:
      true if it is outdated, false else
    • load

      M load(ModelInfo<M> info, List<IMessage> messages)
      Loads the model related to info with a new default import resolver.
      Parameters:
      info - the model info to load the model for
      messages - the messages collected so far (modified as a side effect)
      Returns:
      the loaded model or null
    • load

      M load(ModelInfo<M> info, ImportResolver<M> resolver, List<IMessage> messages)
      Loads the model related to info with the given import resolver.
      Parameters:
      info - the model info to load the model for
      resolver - the import resolver to use (null for a new default resolver)
      messages - the messages collected so far (modified as a side effect)
      Returns:
      the loaded model or null
    • getModelInfo

      ModelInfo<M> getModelInfo(String name, Version version, URI uri)
      Returns a known model information object via its URI.
      Parameters:
      name - the name of the model to search for
      version - the version of the model to search for
      uri - the URI to search for
      Returns:
      the related model information object (or null if not found)
    • getLocationFor

      ModelLocations.Location getLocationFor(URI uri)
      Returns the location for uri.
      Parameters:
      uri - the URI to search for
      Returns:
      the related location
    • getMatchingModelNames

      List<String> getMatchingModelNames(String name)
      Returns the matching model names for a potential wildcard name.
      Parameters:
      name - the name to return the matches for
      Returns:
      if name is a wildcard name, all known matching names; else, name
    • createModel

      M createModel(String modelName, List<M> imports)
      Creates an ad-hoc model with given models as imports.
      Parameters:
      modelName - the model name
      imports - the imports
      Returns:
      the model instance