Package net.ssehub.easy.varModel.model
Class ProjectImport
- java.lang.Object
-
- net.ssehub.easy.basics.modelManagement.ModelImport<Project>
-
- net.ssehub.easy.varModel.model.ProjectImport
-
public class ProjectImport extends ModelImport<Project>
Defines an import and his restrictions.- Author:
- Marcel Lueder, Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringinterfaceNameprivate booleanisCopiedprivate IResolutionScopescope-
Fields inherited from class net.ssehub.easy.basics.modelManagement.ModelImport
WILDCARD_POSTFIX
-
-
Constructor Summary
Constructors Constructor Description ProjectImport()Constructor for serialization.ProjectImport(java.lang.String projectName)Simplified constructor for an unrestricted (non-inserting) import of a project.ProjectImport(java.lang.String projectName, java.lang.String interfaceName)Simplified constructor for an unrestricted (non-inserting) import.ProjectImport(java.lang.String projectName, java.lang.String interfaceName, boolean isConflict, boolean isCopied, IVersionRestriction restriction)Creates a (non-inserting) project import.ProjectImport(java.lang.String projectName, java.lang.String interfaceName, boolean isConflict, boolean isCopied, IVersionRestriction restriction, boolean isInsert)Creates a project import.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IModelVisitor visitor)Accept method for the visitor.ProjectImportcopy(java.lang.String modelName)Creates a copy of this import.java.lang.StringgetInterfaceName()Returns the name of the interface ingetProjectName()being imported.java.lang.StringgetProjectName()Returns the name of the project being imported.java.lang.StringgetQualifiedName()Returns the qualified name of the imported element.IResolutionScopegetScope()Returns the specific scope introduced by this import.booleanisCopied()Returns whether the imported project shall be copied.voidsetResolved(Project resolved)Defines the resolved project instance.-
Methods inherited from class net.ssehub.easy.basics.modelManagement.ModelImport
copyVersionRestriction, evaluateRestrictions, getName, getResolved, getVersionRestriction, isConflict, isInsert, isResolved, isWildcard, isWildcard, setRestrictions
-
-
-
-
Field Detail
-
interfaceName
private java.lang.String interfaceName
-
scope
private IResolutionScope scope
-
isCopied
private boolean isCopied
-
-
Constructor Detail
-
ProjectImport
ProjectImport()
Constructor for serialization.
-
ProjectImport
public ProjectImport(java.lang.String projectName)
Simplified constructor for an unrestricted (non-inserting) import of a project.- Parameters:
projectName- the name of the project to be import, becomes a wildcard import ifnameends withModelImport.WILDCARD_POSTFIX
-
ProjectImport
public ProjectImport(java.lang.String projectName, java.lang.String interfaceName)Simplified constructor for an unrestricted (non-inserting) import.- Parameters:
projectName- the name of the project to be import, becomes a wildcard import ifnameends withModelImport.WILDCARD_POSTFIXinterfaceName- the name of the interface to be imported (may be null in case that an entire project without interfaces is being imported)
-
ProjectImport
public ProjectImport(java.lang.String projectName, java.lang.String interfaceName, boolean isConflict, boolean isCopied, IVersionRestriction restriction)Creates a (non-inserting) project import.- Parameters:
projectName- the name of the project to be import, becomes a wildcard import ifnameends withModelImport.WILDCARD_POSTFIXinterfaceName- the name of the interface to be imported (may be null)isConflict- does this object represent a conflict or an importisCopied- true if the project should be copied / false if it should be referencedrestriction- the version restrictions (may be null if absent)
-
ProjectImport
public ProjectImport(java.lang.String projectName, java.lang.String interfaceName, boolean isConflict, boolean isCopied, IVersionRestriction restriction, boolean isInsert)Creates a project import.- Parameters:
projectName- the name of the project to be import, becomes a wildcard import ifnameends withModelImport.WILDCARD_POSTFIXinterfaceName- the name of the interface to be imported (may be null)isConflict- does this object represent a conflict or an importisCopied- true if the project should be copied / false if it should be referencedrestriction- the version restrictions (may be null if absent)isInsert- whether model elements of the resolved model shall be (virtually) insert at the end of the importing model
-
-
Method Detail
-
accept
public void accept(IModelVisitor visitor)
Accept method for the visitor.
This method is used for saving this model element.- Parameters:
visitor- The visitor, which should save this model element.
-
getProjectName
public java.lang.String getProjectName()
Returns the name of the project being imported. In fact, this is a frontend forModelImport.getName().- Returns:
- the project name
- See Also:
ModelImport.getName()
-
getInterfaceName
public java.lang.String getInterfaceName()
Returns the name of the interface ingetProjectName()being imported.- Returns:
- the interface name (may be null in case that an entire project without interfaces is being imported)
-
setResolved
public void setResolved(Project resolved) throws ModelManagementException
Defines the resolved project instance. This method determines also the scope.- Overrides:
setResolvedin classModelImport<Project>- Parameters:
resolved- the resolved instance or null- Throws:
ModelManagementException- in case of violated project access restrictions
-
getScope
public IResolutionScope getScope()
Returns the specific scope introduced by this import. Typically, this is the project and in case ofgetInterfaceName()this is the imported interface (if it exists).- Returns:
- the scope (imported project or interface)
-
getQualifiedName
public java.lang.String getQualifiedName()
Returns the qualified name of the imported element.- Returns:
- the qualified name
-
isCopied
public boolean isCopied()
Returns whether the imported project shall be copied.- Returns:
trueif it shall be copied upon import,falseif a reference to a shared instance is sufficient.
-
copy
public ProjectImport copy(java.lang.String modelName)
Description copied from class:ModelImportCreates a copy of this import.- Overrides:
copyin classModelImport<Project>- Parameters:
modelName- a new model name, may be null for the original- Returns:
- the copied instance
-
-