Package net.ssehub.easy.varModel.model
Class ProjectImport
java.lang.Object
net.ssehub.easy.basics.modelManagement.ModelImport<Project>
net.ssehub.easy.varModel.model.ProjectImport
Defines an import and his restrictions.
- Author:
- Marcel Lueder, Holger Eichelberger
-
Field Summary
FieldsFields inherited from class net.ssehub.easy.basics.modelManagement.ModelImport
WILDCARD_POSTFIX -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for serialization.ProjectImport(String projectName) Simplified constructor for an unrestricted (non-inserting) import of a project.ProjectImport(String projectName, String interfaceName) Simplified constructor for an unrestricted (non-inserting) import.ProjectImport(String projectName, String interfaceName, boolean isConflict, boolean isCopied, net.ssehub.easy.basics.modelManagement.IVersionRestriction restriction) Creates a (non-inserting) project import.ProjectImport(String projectName, String interfaceName, boolean isConflict, boolean isCopied, net.ssehub.easy.basics.modelManagement.IVersionRestriction restriction, boolean isInsert) Creates a project import. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IModelVisitor visitor) Accept method for the visitor.Returns the name of the interface ingetProjectName()being imported.Returns the name of the project being imported.Returns the qualified name of the imported element.getScope()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 Details
-
interfaceName
-
scope
-
isCopied
private boolean isCopied
-
-
Constructor Details
-
ProjectImport
ProjectImport()Constructor for serialization. -
ProjectImport
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
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(String projectName, String interfaceName, boolean isConflict, boolean isCopied, net.ssehub.easy.basics.modelManagement.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(String projectName, String interfaceName, boolean isConflict, boolean isCopied, net.ssehub.easy.basics.modelManagement.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 Details
-
accept
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
Returns the name of the project being imported. In fact, this is a frontend forModelImport.getName().- Returns:
- the project name
- See Also:
-
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 net.ssehub.easy.basics.modelManagement.ModelManagementException Defines the resolved project instance. This method determines also the scope.- Overrides:
setResolvedin classnet.ssehub.easy.basics.modelManagement.ModelImport<Project>- Parameters:
resolved- the resolved instance or null- Throws:
net.ssehub.easy.basics.modelManagement.ModelManagementException- in case of violated project access restrictions
-
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
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
- Overrides:
copyin classnet.ssehub.easy.basics.modelManagement.ModelImport<Project>
-