Class ProjectImport


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

      Constructors 
      Constructor Description
      ProjectImport()
      Constructor for serialization.
      ProjectImport​(java.lang.String projectName)
      Simplified constructor for an unrestricted import of a project.
      ProjectImport​(java.lang.String projectName, java.lang.String interfaceName)
      Simplified constructor for an unrestricted import.
      ProjectImport​(java.lang.String projectName, java.lang.String interfaceName, boolean isConflict, boolean isCopied, net.ssehub.easy.basics.modelManagement.IVersionRestriction restriction)
      Explicit Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(IModelVisitor visitor)
      Accept method for the visitor.
      java.lang.String getInterfaceName()
      Returns the name of the interface in getProjectName() being imported.
      java.lang.String getProjectName()
      Returns the name of the project being imported.
      java.lang.String getQualifiedName()
      Returns the qualified name of the imported element.
      IResolutionScope getScope()
      Returns the specific scope introduced by this import.
      boolean isCopied()
      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, isResolved, setRestrictions
      • Methods inherited from class java.lang.Object

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

      • interfaceName

        private java.lang.String interfaceName
      • isCopied

        private boolean isCopied
    • Constructor Detail

      • ProjectImport

        ProjectImport()
        Constructor for serialization.
      • ProjectImport

        public ProjectImport​(java.lang.String projectName)
        Simplified constructor for an unrestricted import of a project.
        Parameters:
        projectName - the name of the project to be import
      • ProjectImport

        public ProjectImport​(java.lang.String projectName,
                             java.lang.String interfaceName)
        Simplified constructor for an unrestricted import.
        Parameters:
        projectName - the name of the project to be import
        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​(java.lang.String projectName,
                             java.lang.String interfaceName,
                             boolean isConflict,
                             boolean isCopied,
                             net.ssehub.easy.basics.modelManagement.IVersionRestriction restriction)
        Explicit Constructor.
        Parameters:
        projectName - the name of the project to be import
        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)
    • 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 for ModelImport.getName().
        Returns:
        the project name
        See Also:
        ModelImport.getName()
      • getInterfaceName

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