Class ProjectImport

java.lang.Object
net.ssehub.easy.basics.modelManagement.ModelImport<Project>
net.ssehub.easy.varModel.model.ProjectImport

public class ProjectImport extends net.ssehub.easy.basics.modelManagement.ModelImport<Project>
Defines an import and his restrictions.
Author:
Marcel Lueder, Holger Eichelberger
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
     
    private boolean
     
     

    Fields inherited from class net.ssehub.easy.basics.modelManagement.ModelImport

    WILDCARD_POSTFIX
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor 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 Type
    Method
    Description
    void
    Accept method for the visitor.
    copy(String modelName)
     
    Returns the name of the interface in getProjectName() being imported.
    Returns the name of the project being imported.
    Returns the qualified name of the imported element.
    Returns the specific scope introduced by this import.
    boolean
    Returns whether the imported project shall be copied.
    void
    setResolved(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • interfaceName

      private String interfaceName
    • scope

      private IResolutionScope scope
    • isCopied

      private boolean isCopied
  • Constructor Details

    • ProjectImport

      ProjectImport()
      Constructor for serialization.
    • ProjectImport

      public ProjectImport(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 if name ends with ModelImport.WILDCARD_POSTFIX
    • ProjectImport

      public ProjectImport(String projectName, String interfaceName)
      Simplified constructor for an unrestricted (non-inserting) import.
      Parameters:
      projectName - the name of the project to be import, becomes a wildcard import if name ends with ModelImport.WILDCARD_POSTFIX
      interfaceName - 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 if name ends with ModelImport.WILDCARD_POSTFIX
      interfaceName - the name of the interface to be imported (may be null)
      isConflict - does this object represent a conflict or an import
      isCopied - true if the project should be copied / false if it should be referenced
      restriction - 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 if name ends with ModelImport.WILDCARD_POSTFIX
      interfaceName - the name of the interface to be imported (may be null)
      isConflict - does this object represent a conflict or an import
      isCopied - true if the project should be copied / false if it should be referenced
      restriction - 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

      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 String getProjectName()
      Returns the name of the project being imported. In fact, this is a frontend for ModelImport.getName().
      Returns:
      the project name
      See Also:
      • ModelImport.getName()
    • getInterfaceName

      public String getInterfaceName()
      Returns the name of the interface in getProjectName() 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:
      setResolved in class net.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

      public IResolutionScope getScope()
      Returns the specific scope introduced by this import. Typically, this is the project and in case of getInterfaceName() this is the imported interface (if it exists).
      Returns:
      the scope (imported project or interface)
    • getQualifiedName

      public 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:
      true if it shall be copied upon import, false if a reference to a shared instance is sufficient.
    • copy

      public ProjectImport copy(String modelName)
      Overrides:
      copy in class net.ssehub.easy.basics.modelManagement.ModelImport<Project>