Class IModelAccess

java.lang.Object
net.ssehub.easy.integration.common.IModelAccess

public abstract class IModelAccess extends Object
A basic class providing access to models. Specific tool integrations shall add specific methods on how to access or even create models.
Author:
Holger Eichelberger
  • Constructor Details

    • IModelAccess

      public IModelAccess()
  • Method Details

    • matchesOrigin

      protected boolean matchesOrigin(IModelInfo info)
      Returns whether the model information matches this origin.
      Parameters:
      info - the model information instance
      Returns:
      true if the origins match, false else
      Throws:
      IllegalArgumentException - in case that info is null or does not match to this implementation
    • checkInfo

      protected void checkInfo(IModelInfo info)
      Checks the validity of info.
      Parameters:
      info - the instance to check
      Throws:
      IllegalArgumentException - in case that info is null or does not match to this implementation
    • getInfo

      protected net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.varModel.model.Project> getInfo(IModelInfo info)
      Returns the stored project information instance.
      Parameters:
      info - the model information instance
      Returns:
      the contained project information instance
      Throws:
      IllegalArgumentException - in case that info is null or does not match to this implementation
    • createInfo

      protected IModelInfo createInfo(net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.varModel.model.Project> info, IModelAccess access)
      Factory method for creating a project information object.
      Parameters:
      info - the project info instance to be wrapped
      access - the instance which created this object (for consistency reasons)
      Returns:
      the created instance
    • obtainProject

      protected net.ssehub.easy.varModel.model.Project obtainProject(IModelInfo info) throws ModelException
      Obtains a project.
      Parameters:
      info - the model information instance representing the project to obtain
      Returns:
      the project instance
      Throws:
      ModelException - in case of errors during obtaining/loading the model
      IllegalArgumentException - in case that info is null or does not match to this implementation
    • getMostRecentModel

      public static IModelInfo getMostRecentModel(List<IModelInfo> models)
      Returns the most recent (regarding its version number) model out of the given set of models.
      Parameters:
      models - the models to search within
      Returns:
      the most recent model (may be null if models is empty)