Interface INamespace
The public interface for Namespace
[DefaultImplementationType(typeof(Namespace))]
[XmlDefaultImplementationType(typeof(Namespace))]
[ModelRepresentationClass("http://schema.omg.org/spec/MOF/2.0/cmof.xml#//Namespace")]
public interface INamespace : INamedElement, IElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
- Inherited Members
Properties
ElementImport
References the ElementImports owned by the Namespace. Subsets Element::ownedElement.
[Browsable(false)]
[XmlElementName("elementImport")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("importingNamespace")]
IOrderedSetExpression<IElementImport> ElementImport { get; }
Property Value
OwnedRule
The ownedRule property
[Browsable(false)]
[XmlElementName("ownedRule")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("namespace")]
IListExpression<IConstraint> OwnedRule { get; }
Property Value
PackageImport
References the PackageImports owned by the Namespace. Subsets Element::ownedElement.
[Browsable(false)]
[XmlElementName("packageImport")]
[XmlAttribute(false)]
[Containment]
[XmlOpposite("importingNamespace")]
IOrderedSetExpression<IPackageImport> PackageImport { get; }
Property Value
Methods
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)))
ISetExpression<IPackageableElement> ExcludeCollisions(IEnumerable<IPackageableElement> imps)
Parameters
Returns
GetImportedMembers()
The importedMember property is derived from the ElementImports and the PackageImports. References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports. result = self.importMembers(self.elementImport.importedElement.asSet()->union(self.packageImport.importedPackage->collect(p | p.visibleMembers())))
ISetExpression<IPackageableElement> GetImportedMembers()
Returns
GetNamesOfMember(INamedElement)
The query getNamesOfMember() is overridden to take account of importing. It gives back the set of names that an element would have in an importing namespace, either because it is owned, or if not owned then imported individually, or if not individually then from a package. result = if self.ownedMember->includes(element) then Set{}->include(element.name) else let elementImports: ElementImport = self.elementImport->select(ei | ei.importedElement = element) in if elementImports->notEmpty() then elementImports->collect(el | el.getName()) else self.packageImport->select(pi | pi.importedPackage.visibleMembers()->includes(element))->collect(pi | pi.importedPackage.getNamesOfMember(element)) endif endif
ISetExpression<string> GetNamesOfMember(INamedElement element)
Parameters
element
INamedElement
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 owned members, and also excludes elements which would have the same name when imported. result = self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | mem.imp.isDistinguishableFrom(mem, self)))
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 = self.member->forAll( memb | self.member->excluding(memb)->forAll(other | memb.isDistinguishableFrom(other, self)))
bool MembersAreDistinguishable()
Returns
Members_are_distinguishable(object, object)
All the members of a Namespace are distinguishable within it. membersAreDistinguishable()
bool Members_are_distinguishable(object diagnostics, object context)