Class IModelAccess
- java.lang.Object
-
- net.ssehub.easy.integration.common.IModelAccess
-
- Direct Known Subclasses:
IModelAccess
public abstract class IModelAccess extends java.lang.ObjectA 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 Constructor Description IModelAccess()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckInfo(IModelInfo info)Checks the validity ofinfo.protected IModelInfocreateInfo(ModelInfo<Project> info, IModelAccess access)Factory method for creating a project information object.protected ModelInfo<Project>getInfo(IModelInfo info)Returns the stored project information instance.static IModelInfogetMostRecentModel(java.util.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 ProjectobtainProject(IModelInfo info)Obtains a project.
-
-
-
Method Detail
-
matchesOrigin
protected boolean matchesOrigin(IModelInfo info)
Returns whether the model information matches this origin.- Parameters:
info- the model information instance- Returns:
trueif the origins match,falseelse- Throws:
java.lang.IllegalArgumentException- in case thatinfois null or does not match to this implementation
-
checkInfo
protected void checkInfo(IModelInfo info)
Checks the validity ofinfo.- Parameters:
info- the instance to check- Throws:
java.lang.IllegalArgumentException- in case thatinfois null or does not match to this implementation
-
getInfo
protected ModelInfo<Project> getInfo(IModelInfo info)
Returns the stored project information instance.- Parameters:
info- the model information instance- Returns:
- the contained project information instance
- Throws:
java.lang.IllegalArgumentException- in case thatinfois null or does not match to this implementation
-
createInfo
protected IModelInfo createInfo(ModelInfo<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 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 modeljava.lang.IllegalArgumentException- in case thatinfois null or does not match to this implementation
-
getMostRecentModel
public static IModelInfo getMostRecentModel(java.util.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
modelsis empty)
-
-