All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.uml2.uml.Namespace Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2005, 2014 IBM Corporation, Embarcadero Technologies, CEA, and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   IBM - initial API and implementation
 *   Kenn Hussey (Embarcadero Technologies) - 205188
 *   Kenn Hussey (CEA) - 327039, 351774, 418466
 *   Christian W. Damus (CEA) - 251963
 *
 */
package org.eclipse.uml2.uml;

import java.util.Map;

import org.eclipse.emf.common.util.DiagnosticChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

/**
 * 
 * A representation of the model object 'Namespace'.
 * 
 *
 * 
 * A Namespace is an Element in a model that owns and/or imports a set of NamedElements that can be identified by name.
 * 

From package UML::CommonStructure.

* * *

* The following features are supported: *

    *
  • {@link org.eclipse.uml2.uml.Namespace#getOwnedRules Owned Rule}
  • *
  • {@link org.eclipse.uml2.uml.Namespace#getElementImports Element Import}
  • *
  • {@link org.eclipse.uml2.uml.Namespace#getPackageImports Package Import}
  • *
  • {@link org.eclipse.uml2.uml.Namespace#getOwnedMembers Owned Member}
  • *
  • {@link org.eclipse.uml2.uml.Namespace#getImportedMembers Imported Member}
  • *
  • {@link org.eclipse.uml2.uml.Namespace#getMembers Member}
  • *
*

* * @see org.eclipse.uml2.uml.UMLPackage#getNamespace() * @model abstract="true" * @generated */ public interface Namespace extends NamedElement { /** * Returns the value of the 'Element Import' containment reference list. * The list contents are of type {@link org.eclipse.uml2.uml.ElementImport}. * It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.ElementImport#getImportingNamespace Importing Namespace}'. *

* This feature subsets the following features: *

    *
  • '{@link org.eclipse.uml2.uml.Element#getOwnedElements() Owned Element}'
  • *
*

* * * * References the ElementImports owned by the Namespace. *

From package UML::CommonStructure.

* * @return the value of the 'Element Import' containment reference list. * @see org.eclipse.uml2.uml.UMLPackage#getNamespace_ElementImport() * @see org.eclipse.uml2.uml.ElementImport#getImportingNamespace * @model opposite="importingNamespace" containment="true" resolveProxies="true" ordered="false" * @generated */ EList getElementImports(); /** * Creates a new {@link org.eclipse.uml2.uml.ElementImport}, with the specified 'Imported Element', and appends it to the 'Element Import' containment reference list. * * * @param importedElement The 'Imported Element' for the new {@link org.eclipse.uml2.uml.ElementImport}, or null. * @return The new {@link org.eclipse.uml2.uml.ElementImport}. * @see #getElementImports() * @generated */ ElementImport createElementImport(PackageableElement importedElement); /** * Retrieves the first {@link org.eclipse.uml2.uml.ElementImport} with the specified 'Imported Element' from the 'Element Import' containment reference list. * * * @param importedElement The 'Imported Element' of the {@link org.eclipse.uml2.uml.ElementImport} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.ElementImport} with the specified 'Imported Element', or null. * @see #getElementImports() * @generated */ ElementImport getElementImport(PackageableElement importedElement); /** * Retrieves the first {@link org.eclipse.uml2.uml.ElementImport} with the specified 'Imported Element' from the 'Element Import' containment reference list. * * * @param importedElement The 'Imported Element' of the {@link org.eclipse.uml2.uml.ElementImport} to retrieve, or null. * @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.ElementImport} on demand if not found. * @return The first {@link org.eclipse.uml2.uml.ElementImport} with the specified 'Imported Element', or null. * @see #getElementImports() * @generated */ ElementImport getElementImport(PackageableElement importedElement, boolean createOnDemand); /** * Returns the value of the 'Package Import' containment reference list. * The list contents are of type {@link org.eclipse.uml2.uml.PackageImport}. * It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.PackageImport#getImportingNamespace Importing Namespace}'. *

* This feature subsets the following features: *

    *
  • '{@link org.eclipse.uml2.uml.Element#getOwnedElements() Owned Element}'
  • *
*

* * * * References the PackageImports owned by the Namespace. *

From package UML::CommonStructure.

* * @return the value of the 'Package Import' containment reference list. * @see org.eclipse.uml2.uml.UMLPackage#getNamespace_PackageImport() * @see org.eclipse.uml2.uml.PackageImport#getImportingNamespace * @model opposite="importingNamespace" containment="true" resolveProxies="true" ordered="false" * @generated */ EList getPackageImports(); /** * Creates a new {@link org.eclipse.uml2.uml.PackageImport}, with the specified 'Imported Package', and appends it to the 'Package Import' containment reference list. * * * @param importedPackage The 'Imported Package' for the new {@link org.eclipse.uml2.uml.PackageImport}, or null. * @return The new {@link org.eclipse.uml2.uml.PackageImport}. * @see #getPackageImports() * @generated */ PackageImport createPackageImport( org.eclipse.uml2.uml.Package importedPackage); /** * Retrieves the first {@link org.eclipse.uml2.uml.PackageImport} with the specified 'Imported Package' from the 'Package Import' containment reference list. * * * @param importedPackage The 'Imported Package' of the {@link org.eclipse.uml2.uml.PackageImport} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.PackageImport} with the specified 'Imported Package', or null. * @see #getPackageImports() * @generated */ PackageImport getPackageImport(org.eclipse.uml2.uml.Package importedPackage); /** * Retrieves the first {@link org.eclipse.uml2.uml.PackageImport} with the specified 'Imported Package' from the 'Package Import' containment reference list. * * * @param importedPackage The 'Imported Package' of the {@link org.eclipse.uml2.uml.PackageImport} to retrieve, or null. * @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.PackageImport} on demand if not found. * @return The first {@link org.eclipse.uml2.uml.PackageImport} with the specified 'Imported Package', or null. * @see #getPackageImports() * @generated */ PackageImport getPackageImport( org.eclipse.uml2.uml.Package importedPackage, boolean createOnDemand); /** * Returns the value of the 'Owned Rule' containment reference list. * The list contents are of type {@link org.eclipse.uml2.uml.Constraint}. * It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.Constraint#getContext Context}'. *

* This feature subsets the following features: *

    *
  • '{@link org.eclipse.uml2.uml.Namespace#getOwnedMembers() Owned Member}'
  • *
*

* * * * Specifies a set of Constraints owned by this Namespace. *

From package UML::CommonStructure.

* * @return the value of the 'Owned Rule' containment reference list. * @see org.eclipse.uml2.uml.UMLPackage#getNamespace_OwnedRule() * @see org.eclipse.uml2.uml.Constraint#getContext * @model opposite="context" containment="true" resolveProxies="true" ordered="false" * @generated */ EList getOwnedRules(); /** * Creates a new {@link org.eclipse.uml2.uml.Constraint}, with the specified 'Name', and appends it to the 'Owned Rule' containment reference list. * * * @param name The 'Name' for the new {@link org.eclipse.uml2.uml.Constraint}, or null. * @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Constraint} to create. * @return The new {@link org.eclipse.uml2.uml.Constraint}. * @see #getOwnedRules() * @generated */ Constraint createOwnedRule(String name, EClass eClass); /** * Creates a new {@link org.eclipse.uml2.uml.Constraint}, with the specified 'Name', and appends it to the 'Owned Rule' containment reference list. * * * @param name The 'Name' for the new {@link org.eclipse.uml2.uml.Constraint}, or null. * @return The new {@link org.eclipse.uml2.uml.Constraint}. * @see #getOwnedRules() * @generated */ Constraint createOwnedRule(String name); /** * Retrieves the first {@link org.eclipse.uml2.uml.Constraint} with the specified 'Name' from the 'Owned Rule' containment reference list. * * * @param name The 'Name' of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.Constraint} with the specified 'Name', or null. * @see #getOwnedRules() * @generated */ Constraint getOwnedRule(String name); /** * Retrieves the first {@link org.eclipse.uml2.uml.Constraint} with the specified 'Name' from the 'Owned Rule' containment reference list. * * * @param name The 'Name' of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or null. * @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons. * @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.Constraint} to retrieve, or null. * @param createOnDemand Whether to create a {@link org.eclipse.uml2.uml.Constraint} on demand if not found. * @return The first {@link org.eclipse.uml2.uml.Constraint} with the specified 'Name', or null. * @see #getOwnedRules() * @generated */ Constraint getOwnedRule(String name, boolean ignoreCase, EClass eClass, boolean createOnDemand); /** * Returns the value of the 'Member' reference list. * The list contents are of type {@link org.eclipse.uml2.uml.NamedElement}. * This feature is a derived union. * * * * A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance. *

From package UML::CommonStructure.

* * @return the value of the 'Member' reference list. * @see org.eclipse.uml2.uml.UMLPackage#getNamespace_Member() * @model transient="true" changeable="false" volatile="true" derived="true" ordered="false" * @generated */ EList getMembers(); /** * Retrieves the first {@link org.eclipse.uml2.uml.NamedElement} with the specified 'Name' from the 'Member' reference list. * * * @param name The 'Name' of the {@link org.eclipse.uml2.uml.NamedElement} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.NamedElement} with the specified 'Name', or null. * @see #getMembers() * @generated */ NamedElement getMember(String name); /** * Retrieves the first {@link org.eclipse.uml2.uml.NamedElement} with the specified 'Name' from the 'Member' reference list. * * * @param name The 'Name' of the {@link org.eclipse.uml2.uml.NamedElement} to retrieve, or null. * @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons. * @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.NamedElement} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.NamedElement} with the specified 'Name', or null. * @see #getMembers() * @generated */ NamedElement getMember(String name, boolean ignoreCase, EClass eClass); /** * Returns the value of the 'Imported Member' reference list. * The list contents are of type {@link org.eclipse.uml2.uml.PackageableElement}. *

* This feature subsets the following features: *

    *
  • '{@link org.eclipse.uml2.uml.Namespace#getMembers() Member}'
  • *
*

* * * * References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports. *

From package UML::CommonStructure.

* * @return the value of the 'Imported Member' reference list. * @see org.eclipse.uml2.uml.UMLPackage#getNamespace_ImportedMember() * @model transient="true" changeable="false" volatile="true" derived="true" ordered="false" * @generated */ EList getImportedMembers(); /** * Retrieves the first {@link org.eclipse.uml2.uml.PackageableElement} with the specified 'Name' from the 'Imported Member' reference list. * * * @param name The 'Name' of the {@link org.eclipse.uml2.uml.PackageableElement} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.PackageableElement} with the specified 'Name', or null. * @see #getImportedMembers() * @generated */ PackageableElement getImportedMember(String name); /** * Retrieves the first {@link org.eclipse.uml2.uml.PackageableElement} with the specified 'Name' from the 'Imported Member' reference list. * * * @param name The 'Name' of the {@link org.eclipse.uml2.uml.PackageableElement} to retrieve, or null. * @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons. * @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.PackageableElement} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.PackageableElement} with the specified 'Name', or null. * @see #getImportedMembers() * @generated */ PackageableElement getImportedMember(String name, boolean ignoreCase, EClass eClass); /** * Returns the value of the 'Owned Member' reference list. * The list contents are of type {@link org.eclipse.uml2.uml.NamedElement}. * It is bidirectional and its opposite is '{@link org.eclipse.uml2.uml.NamedElement#getNamespace Namespace}'. *

* This feature subsets the following features: *

    *
  • '{@link org.eclipse.uml2.uml.Element#getOwnedElements() Owned Element}'
  • *
  • '{@link org.eclipse.uml2.uml.Namespace#getMembers() Member}'
  • *
*

* This feature is a derived union. * * * * A collection of NamedElements owned by the Namespace. *

From package UML::CommonStructure.

* * @return the value of the 'Owned Member' reference list. * @see org.eclipse.uml2.uml.UMLPackage#getNamespace_OwnedMember() * @see org.eclipse.uml2.uml.NamedElement#getNamespace * @model opposite="namespace" transient="true" changeable="false" volatile="true" derived="true" ordered="false" * @generated */ EList getOwnedMembers(); /** * Retrieves the first {@link org.eclipse.uml2.uml.NamedElement} with the specified 'Name' from the 'Owned Member' reference list. * * * @param name The 'Name' of the {@link org.eclipse.uml2.uml.NamedElement} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.NamedElement} with the specified 'Name', or null. * @see #getOwnedMembers() * @generated */ NamedElement getOwnedMember(String name); /** * Retrieves the first {@link org.eclipse.uml2.uml.NamedElement} with the specified 'Name' from the 'Owned Member' reference list. * * * @param name The 'Name' of the {@link org.eclipse.uml2.uml.NamedElement} to retrieve, or null. * @param ignoreCase Whether to ignore case in {@link java.lang.String} comparisons. * @param eClass The Ecore class of the {@link org.eclipse.uml2.uml.NamedElement} to retrieve, or null. * @return The first {@link org.eclipse.uml2.uml.NamedElement} with the specified 'Name', or null. * @see #getOwnedMembers() * @generated */ NamedElement getOwnedMember(String name, boolean ignoreCase, EClass eClass); /** * * * * All the members of a Namespace are distinguishable within it. * membersAreDistinguishable() * @param diagnostics The chain of diagnostics to which problems are to be appended. * @param context The cache of context-specific information. * * @model * @generated */ boolean validateMembersDistinguishable(DiagnosticChain diagnostics, Map context); /** * * * * A Namespace cannot have a PackageImport to itself. * packageImport.importedPackage.oclAsType(Namespace)->excludes(self) * @param diagnostics The chain of diagnostics to which problems are to be appended. * @param context The cache of context-specific information. * * @model * @generated */ boolean validateCannotImportSelf(DiagnosticChain diagnostics, Map context); /** * * * * A Namespace cannot have an ElementImport to one of its ownedMembers. * elementImport.importedElement.oclAsType(Element)->excludesAll(ownedMember) * @param diagnostics The chain of diagnostics to which problems are to be appended. * @param context The cache of context-specific information. * * @model * @generated */ boolean validateCannotImportOwnedMembers(DiagnosticChain diagnostics, Map context); /** * * * * Creates an import of the specified element into this namespace with the specified visibility. * @param element The element to import. * @param visibility The visibility for the new element import. * * @model required="true" ordered="false" elementRequired="true" elementOrdered="false" visibilityRequired="true" visibilityOrdered="false" * @generated */ ElementImport createElementImport(PackageableElement element, VisibilityKind visibility); /** * * * * Creates an import of the specified package into this namespace with the specified visibility. * @param package_ The package to import. * @param visibility The visibility for the new package import. * * @model required="true" ordered="false" package_Required="true" package_Ordered="false" visibilityRequired="true" visibilityOrdered="false" * @generated */ PackageImport createPackageImport(org.eclipse.uml2.uml.Package package_, VisibilityKind visibility); /** * * * * Retrieves the elements imported by this namespace. * * @model kind="operation" ordered="false" * @generated */ EList getImportedElements(); /** * * * * Retrieves the packages imported by this namespace. * * @model kind="operation" ordered="false" * @generated */ EList getImportedPackages(); /** * * * * The query getNamesOfMember() gives a set of all of the names that a member would have in a Namespace, taking importing into account. In general a member can have multiple names in a Namespace if it is imported more than once with different aliases. * result = (if self.ownedMember ->includes(element) * then Set{element.name} * else let elementImports : Set(ElementImport) = self.elementImport->select(ei | ei.importedElement = element) in * if elementImports->notEmpty() * then * elementImports->collect(el | el.getName())->asSet() * else * self.packageImport->select(pi | pi.importedPackage.visibleMembers().oclAsType(NamedElement)->includes(element))-> collect(pi | pi.importedPackage.getNamesOfMember(element))->asSet() * endif * endif) *

From package UML::CommonStructure.

* * @model dataType="org.eclipse.uml2.types.String" ordered="false" elementRequired="true" elementOrdered="false" * @generated */ EList getNamesOfMember(NamedElement element); /** * * * * The Boolean query membersAreDistinguishable() determines whether all of the Namespace's members are distinguishable within it. * result = (member->forAll( memb | * member->excluding(memb)->forAll(other | * memb.isDistinguishableFrom(other, self)))) *

From package UML::CommonStructure.

* * @model dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" * @generated */ boolean membersAreDistinguishable(); /** * * * * The query importMembers() defines which of a set of PackageableElements are actually imported into the Namespace. This excludes hidden ones, i.e., those which have names that conflict with names of ownedMembers, and it also excludes PackageableElements that would have the indistinguishable names when imported. * result = (self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | imp.isDistinguishableFrom(mem, self)))) *

From package UML::CommonStructure.

* * @model ordered="false" impsMany="true" impsOrdered="false" * @generated */ EList importMembers(EList imps); /** * * * * The query excludeCollisions() excludes from a set of PackageableElements any that would not be distinguishable from each other in this Namespace. * result = (imps->reject(imp1 | imps->exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))) *

From package UML::CommonStructure.

* * @model ordered="false" impsMany="true" impsOrdered="false" * @generated */ EList excludeCollisions(EList imps); } // Namespace




© 2015 - 2024 Weber Informatics LLC | Privacy Policy