Class ProjectImport


  • public class ProjectImport
    extends ModelImport<Project>
    Defines an import and his restrictions.
    Author:
    Marcel Lueder, Holger Eichelberger
    • 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 (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​(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 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​(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 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​(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 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 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)
      • 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.
      • copy

        public ProjectImport copy​(java.lang.String modelName)
        Description copied from class: ModelImport
        Creates a copy of this import.
        Overrides:
        copy in class ModelImport<Project>
        Parameters:
        modelName - a new model name, may be null for the original
        Returns:
        the copied instance