|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A representation of the model object 'Namespace'. A namespace is a named element that can own other named elements. Each named element may be owned by at most one namespace. A namespace provides a means for identifying named elements by name. Named elements can be identified by name in a namespace either by being directly owned by the namespace or by being introduced into the namespace by other means e.g. importing or inheriting. Namespace is an abstract metaclass. A namespace can own constraints. The constraint does not necessarily apply to the namespace itself, but may also apply to elements in the namespace. A namespace has the ability to import either individial members or all members of a package, thereby making it possible to refer to those named elements without qualification in the importing namespace. In the case of conflicts, it is necessary to use qualified names or aliases to disambiguate the referenced elements.
The following features are supported:
UML2Package.getNamespace()
Field Summary | |
static String |
copyright
|
Fields inherited from interface org.eclipse.uml2.NamedElement |
SEPARATOR |
Method Summary | |
ElementImport |
createElementImport(EClass eClass)
Creates a ElementImport and appends it to the 'Element Import' containment reference list |
Constraint |
createOwnedRule(EClass eClass)
Creates a Constraint and appends it to the 'Owned Rule' containment reference list |
PackageImport |
createPackageImport(EClass eClass)
Creates a PackageImport and appends it to the 'Package Import' containment reference list |
Set |
excludeCollisions(Set imps)
A query based on the following OCL expression:
imps->reject(imp1 | imps.exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))
|
EList |
getElementImports()
Returns the value of the 'Element Import' containment reference list. |
PackageableElement |
getImportedMember(String unqualifiedName)
Retrieves the PackageableElement with the specified name from the 'Imported Member' reference list |
EList |
getImportedMembers()
Returns the value of the 'Imported Member' reference list. |
Set |
getImportedPackages()
Retrieves the set of packages imported by this namespace. |
NamedElement |
getMember(String unqualifiedName)
Retrieves the NamedElement with the specified name from the 'Member' reference list |
EList |
getMembers()
Returns the value of the 'Member' reference list. |
Set |
getNamesOfMember(NamedElement element)
A query based on the following OCL expression:
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
|
EList |
getOwnedElements()
|
EList |
getOwnedMembers()
|
Constraint |
getOwnedRule(String unqualifiedName)
Retrieves the Constraint with the specified name from the 'Owned Rule' containment reference list |
EList |
getOwnedRules()
Returns the value of the 'Owned Rule' containment reference list. |
EList |
getPackageImports()
Returns the value of the 'Package Import' containment reference list. |
Set |
importedMember()
A query based on the following OCL expression:
self.importedMembers(self.elementImport.importedElement.asSet()->union(self.packageImport.importedPackage->collect(p | p.visibleMembers())))
|
void |
importElement(VisibilityKind visibility,
PackageableElement element)
Imports the specified element into this namespace with the specified visibility. |
Set |
importMembers(Set imps)
A query based on the following OCL expression:
self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | mem.imp.isDistinguishableFrom(mem, self)))
|
void |
importPackage(VisibilityKind visibility,
Package package_)
Imports the specified package into this namespace with the specified visibility. |
boolean |
membersAreDistinguishable()
A query based on the following OCL expression:
self.member->forAll( memb |
self.member->excluding(memb)->forAll(other |
memb.isDistinguishableFrom(other, self)))
|
boolean |
validateImportedMemberDerived(DiagnosticChain diagnostics,
Map context)
An invariant constraint based on the following OCL expression:
self.importedMember->includesAll(self.importedMembers(self.elementImport.importedElement.asSet()->union(self.packageImport.importedPackage->collect(p | p.visibleMembers()))))
|
boolean |
validateMembersAreDistinguishable(DiagnosticChain diagnostics,
Map context)
An invariant constraint based on the following OCL expression:
membersAreDistinguishable()
|
Methods inherited from interface org.eclipse.uml2.NamedElement |
allNamespaces, createNameExpression, getClientDependencies, getClientDependency, getName, getNameExpression, getNamespace, getOwner, getQualifiedName, getVisibility, isDistinguishableFrom, qualifiedName, separator, setName, setNameExpression, setVisibility, validateNoName, validateQualifiedName, validateVisibilityNeedsOwnership |
Methods inherited from interface org.eclipse.uml2.TemplateableElement |
createOwnedTemplateSignature, createTemplateBinding, getOwnedTemplateSignature, getTemplateBindings, parameterableElements, setOwnedTemplateSignature |
Methods inherited from interface org.eclipse.uml2.Element |
addKeyword, allOwnedElements, apply, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedVersion, getKeywords, getModel, getNearestPackage, getOwnedComments, getValue, hasKeyword, isApplied, isRequired, mustBeOwned, removeKeyword, setValue, unapply, validateHasOwner, validateNotOwnSelf |
Methods inherited from interface org.eclipse.emf.ecore.EModelElement |
getEAnnotation, getEAnnotations |
Methods inherited from interface org.eclipse.emf.ecore.EObject |
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset |
Methods inherited from interface org.eclipse.emf.common.notify.Notifier |
eAdapters, eDeliver, eNotify, eSetDeliver |
Field Detail |
public static final String copyright
Method Detail |
public EList getMembers()
NamedElement
.
If the meaning of the 'Member' reference list isn't clear, there really should be more of a description here...
A collection of NamedElements identifiable within the Namespace, either by being owned or by being introduced by importing or inheritance. This is a derived union.
UML2Package.getNamespace_Member()
public NamedElement getMember(String unqualifiedName)
NamedElement
with the specified name from the 'Member' reference list.
unqualifiedName
- The unqualified name of the NamedElement
to retrieve.
NamedElement
with the specified name, or null
.getMembers()
public EList getOwnedRules()
Constraint
.
It is bidirectional and its opposite is 'Namespace
'.
If the meaning of the 'Owned Rule' containment reference list isn't clear, there really should be more of a description here...
Specifies a set of Constraints owned by this Namespace. Subsets Namespace::ownedMember.
UML2Package.getNamespace_OwnedRule()
,
Constraint.getNamespace()
public Constraint getOwnedRule(String unqualifiedName)
Constraint
with the specified name from the 'Owned Rule' containment reference list.
unqualifiedName
- The unqualified name of the Constraint
to retrieve.
Constraint
with the specified name, or null
.getOwnedRules()
public Constraint createOwnedRule(EClass eClass)
Constraint
and appends it to the 'Owned Rule' containment reference list.
eClass
- The Ecore class of the Constraint
to create.
Constraint
.getOwnedRules()
public EList getImportedMembers()
PackageableElement
.
If the meaning of the 'Imported Member' reference list isn't clear, there really should be more of a description here...
References the PackageableElements that are members of this Namespace as a result of either PackageImports or ElementImports. Subsets Namespace::member.
UML2Package.getNamespace_ImportedMember()
public PackageableElement getImportedMember(String unqualifiedName)
PackageableElement
with the specified name from the 'Imported Member' reference list.
unqualifiedName
- The unqualified name of the PackageableElement
to retrieve.
PackageableElement
with the specified name, or null
.getImportedMembers()
public EList getElementImports()
ElementImport
.
It is bidirectional and its opposite is 'Importing Namespace
'.
If the meaning of the 'Element Import' containment reference list isn't clear, there really should be more of a description here...
References the ElementImports owned by the Namespace. Subsets Element::ownedElement.
UML2Package.getNamespace_ElementImport()
,
ElementImport.getImportingNamespace()
public ElementImport createElementImport(EClass eClass)
ElementImport
and appends it to the 'Element Import' containment reference list.
eClass
- The Ecore class of the ElementImport
to create.
ElementImport
.getElementImports()
public EList getPackageImports()
PackageImport
.
It is bidirectional and its opposite is 'Importing Namespace
'.
If the meaning of the 'Package Import' containment reference list isn't clear, there really should be more of a description here...
References the PackageImports owned by the Namespace. Subsets Element::ownedElement.
UML2Package.getNamespace_PackageImport()
,
PackageImport.getImportingNamespace()
public PackageImport createPackageImport(EClass eClass)
PackageImport
and appends it to the 'Package Import' containment reference list.
eClass
- The Ecore class of the PackageImport
to create.
PackageImport
.getPackageImports()
public boolean validateMembersAreDistinguishable(DiagnosticChain diagnostics, Map context)
membersAreDistinguishable()
public Set getNamesOfMember(NamedElement element)
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
public boolean membersAreDistinguishable()
self.member->forAll( memb |
self.member->excluding(memb)->forAll(other |
memb.isDistinguishableFrom(other, self)))
public boolean validateImportedMemberDerived(DiagnosticChain diagnostics, Map context)
self.importedMember->includesAll(self.importedMembers(self.elementImport.importedElement.asSet()->union(self.packageImport.importedPackage->collect(p | p.visibleMembers()))))
public Set importedMember()
self.importedMembers(self.elementImport.importedElement.asSet()->union(self.packageImport.importedPackage->collect(p | p.visibleMembers())))
public Set importMembers(Set imps)
self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | mem.imp.isDistinguishableFrom(mem, self)))
public Set excludeCollisions(Set imps)
imps->reject(imp1 | imps.exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))
public EList getOwnedMembers()
public EList getOwnedElements()
getOwnedElements
in interface NamedElement
public void importElement(VisibilityKind visibility, PackageableElement element)
visibility
- The visbility with which to import the element.element
- The element to import.
IllegalArgumentException
- If this namespace already imports the
element.public Set getImportedPackages()
public void importPackage(VisibilityKind visibility, Package package_)
visibility
- The visbility with which to import the package.package_
- The package to import.
IllegalArgumentException
- If this namespace already imports the
package.
|
Copyright 2003, 2004 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |