Class IModelAccess
java.lang.Object
net.ssehub.easy.integration.common.IModelAccess
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckInfo(IModelInfo info) Checks the validity ofinfo.protected IModelInfocreateInfo(net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.varModel.model.Project> info, IModelAccess access) Factory method for creating a project information object.protected net.ssehub.easy.basics.modelManagement.ModelInfo<net.ssehub.easy.varModel.model.Project> getInfo(IModelInfo info) Returns the stored project information instance.static IModelInfogetMostRecentModel(List<IModelInfo> models) Returns the most recent (regarding its version number) model out of the given set of models.protected booleanmatchesOrigin(IModelInfo info) Returns whether the model information matches this origin.protected net.ssehub.easy.varModel.model.ProjectobtainProject(IModelInfo info) Obtains a project.
-
Constructor Details
-
IModelAccess
public IModelAccess()
-
-
Method Details
-
matchesOrigin
Returns whether the model information matches this origin.- Parameters:
info- the model information instance- Returns:
trueif the origins match,falseelse- Throws:
IllegalArgumentException- in case thatinfois null or does not match to this implementation
-
checkInfo
Checks the validity ofinfo.- Parameters:
info- the instance to check- Throws:
IllegalArgumentException- in case thatinfois 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 thatinfois 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 wrappedaccess- 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 modelIllegalArgumentException- in case thatinfois null or does not match to this implementation
-
getMostRecentModel
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
modelsis empty)
-