Class IModelAccess
java.lang.Object
net.ssehub.easy.integration.common.IModelAccess
net.ssehub.easy.integration.common.eclipse.IModelAccess
public abstract class IModelAccess
extends 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 TypeMethodDescriptionstatic org.eclipse.core.runtime.IPathabsoluteToWorkspaceRoot(org.eclipse.core.runtime.IPath path) Makes the given project-relativepathabsolute to the workspace root.List<net.ssehub.easy.integration.common.IModelInfo> getAvailableModels(org.eclipse.core.resources.IProject project) Returns the models which are available for and visible fromproject.net.ssehub.easy.integration.common.IModelInfogetMostRecentTopLevelModel(org.eclipse.core.resources.IProject project) Returns the most recent (regarding its version number) top-level model.List<net.ssehub.easy.integration.common.IModelInfo> getTopLevelModels(org.eclipse.core.resources.IProject project) Returns the top-level models inprojectaccording to EASy conventions.protected net.ssehub.easy.varModel.model.ProjectobtainProject(net.ssehub.easy.integration.common.IModelInfo info) Obtains a project.voidupdateModelInfo(org.eclipse.core.resources.IProject project) Updates the available model information inproject.Methods inherited from class net.ssehub.easy.integration.common.IModelAccess
checkInfo, createInfo, getInfo, getMostRecentModel, matchesOrigin
-
Constructor Details
-
IModelAccess
public IModelAccess()
-
-
Method Details
-
absoluteToWorkspaceRoot
public static org.eclipse.core.runtime.IPath absoluteToWorkspaceRoot(org.eclipse.core.runtime.IPath path) Makes the given project-relativepathabsolute to the workspace root.- Parameters:
path- the path to make absolute- Returns:
- the absolute path
-
getMostRecentTopLevelModel
public net.ssehub.easy.integration.common.IModelInfo getMostRecentTopLevelModel(org.eclipse.core.resources.IProject project) Returns the most recent (regarding its version number) top-level model.- Parameters:
project- the project to return the modle for- Returns:
- the most recent model (may be null if there is none)
-
getTopLevelModels
public List<net.ssehub.easy.integration.common.IModelInfo> getTopLevelModels(org.eclipse.core.resources.IProject project) Returns the top-level models inprojectaccording to EASy conventions.- Parameters:
project- the project to return the default models for- Returns:
- the top-level models as considered by EASy
-
getAvailableModels
public List<net.ssehub.easy.integration.common.IModelInfo> getAvailableModels(org.eclipse.core.resources.IProject project) Returns the models which are available for and visible fromproject. The result of this method may change over time, e.g. when models are created.- Parameters:
project- the project where to start searching / considering models- Returns:
- the model information objects representing available projects
-
obtainProject
protected net.ssehub.easy.varModel.model.Project obtainProject(net.ssehub.easy.integration.common.IModelInfo info) throws net.ssehub.easy.integration.common.ModelException Obtains a project.- Overrides:
obtainProjectin classnet.ssehub.easy.integration.common.IModelAccess- Parameters:
info- the model information instance representing the project to obtain- Returns:
- the project instance
- Throws:
net.ssehub.easy.integration.common.ModelException- in case of errors during obtaining/loading the modelIllegalArgumentException- in case thatinfois null or does not match to this implementation
-
updateModelInfo
public void updateModelInfo(org.eclipse.core.resources.IProject project) throws net.ssehub.easy.integration.common.ModelException Updates the available model information inproject.- Parameters:
project- the project to update the information for- Throws:
net.ssehub.easy.integration.common.ModelException- in case of errors during the update
-