Interface INamespace
The public interface for Namespace
[DefaultImplementationType(typeof(Namespace))]
[XmlDefaultImplementationType(typeof(Namespace))]
[ModelRepresentationClass("http://www.eclipse.org/uml2/5.0.0/UML#//Namespace")]
public interface INamespace : INamedElement, IElement, IEModelElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
- Inherited Members
Properties
ElementImport
References the ElementImports owned by the Namespace. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("elementImport")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("importingNamespace")]
IListExpression<IElementImport> ElementImport { get; }
Property Value
OwnedRule
Specifies a set of Constraints owned by this Namespace. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("ownedRule")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("context")]
IListExpression<IConstraint> OwnedRule { get; }
Property Value
PackageImport
References the PackageImports owned by the Namespace. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("packageImport")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("importingNamespace")]
IListExpression<IPackageImport> PackageImport { get; }
Property Value
Methods
Cannot_import_ownedMembers(object, object)
A Namespace cannot have an ElementImport to one of its ownedMembers. elementImport.importedElement.oclAsType(Element)->excludesAll(ownedMember)
bool Cannot_import_ownedMembers(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
Cannot_import_self(object, object)
A Namespace cannot have a PackageImport to itself. packageImport.importedPackage.oclAsType(Namespace)->excludes(self)
bool Cannot_import_self(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
CreateElementImport(IPackageableElement, VisibilityKind)
Creates an import of the specified element into this namespace with the specified visibility.
IElementImport CreateElementImport(IPackageableElement element, VisibilityKind visibility)
Parameters
element
IPackageableElementThe element to import.
visibility
VisibilityKindThe visibility for the new element import.
Returns
CreatePackageImport(IPackage, VisibilityKind)
Creates an import of the specified package into this namespace with the specified visibility.
IPackageImport CreatePackageImport(IPackage package_, VisibilityKind visibility)
Parameters
package_
IPackageThe package to import.
visibility
VisibilityKindThe visibility for the new package import.
Returns
ExcludeCollisions(IEnumerable<IPackageableElement>)
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)))) <p>From package UML::CommonStructure.</p>
ISetExpression<IPackageableElement> ExcludeCollisions(IEnumerable<IPackageableElement> imps)
Parameters
Returns
GetImportedElements()
Retrieves the elements imported by this namespace.
ISetExpression<IPackageableElement> GetImportedElements()
Returns
GetImportedMembers()
The importedMember property is derived as the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports. result = (self.importMembers(elementImport.importedElement->asSet()->union(packageImport.importedPackage->collect(p | p.visibleMembers()))->asSet())) <p>From package UML::CommonStructure.</p>
ISetExpression<IPackageableElement> GetImportedMembers()
Returns
GetImportedPackages()
Retrieves the packages imported by this namespace.
ISetExpression<IPackage> GetImportedPackages()
Returns
GetNamesOfMember(INamedElement)
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) <p>From package UML::CommonStructure.</p>
ISetExpression<string> GetNamesOfMember(INamedElement element)
Parameters
element
INamedElement
Returns
GetOwnedMembers()
ISetExpression<INamedElement> GetOwnedMembers()
Returns
ImportMembers(IEnumerable<IPackageableElement>)
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)))) <p>From package UML::CommonStructure.</p>
ISetExpression<IPackageableElement> ImportMembers(IEnumerable<IPackageableElement> imps)
Parameters
Returns
MembersAreDistinguishable()
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)))) <p>From package UML::CommonStructure.</p>
bool MembersAreDistinguishable()
Returns
Members_distinguishable(object, object)
All the members of a Namespace are distinguishable within it. membersAreDistinguishable()
bool Members_distinguishable(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.