|
||||||||||||
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 java.lang.String |
copyright
|
Fields inherited from interface org.eclipse.uml2.NamedElement |
---|
SEPARATOR |
Method Summary | |
---|---|
ElementImport |
createElementImport()
Creates a ElementImport and appends it to the 'Element Import' containment reference list |
ElementImport |
createElementImport(EClass eClass)
Deprecated. Use #createElementImport() instead. |
Constraint |
createOwnedRule()
Creates a Constraint and appends it to the 'Owned Rule' containment reference list |
Constraint |
createOwnedRule(EClass eClass)
Creates a Constraint and appends it to the 'Owned Rule' containment reference list |
PackageImport |
createPackageImport()
Creates a PackageImport and appends it to the 'Package Import' containment reference list |
PackageImport |
createPackageImport(EClass eClass)
Creates a PackageImport and appends it to the 'Package Import' containment reference list |
java.util.Set |
excludeCollisions(java.util.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(java.lang.String name)
Retrieves the PackageableElement with the specified 'Name' from the 'Imported Member' reference list |
EList |
getImportedMembers()
Returns the value of the 'Imported Member' reference list. |
java.util.Set |
getImportedPackages()
Retrieves the set of packages imported by this namespace. |
NamedElement |
getMember(java.lang.String name)
Retrieves the NamedElement with the specified 'Name' from the 'Member' reference list |
EList |
getMembers()
Returns the value of the 'Member' reference list. |
java.util.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
|
NamedElement |
getOwnedMember(java.lang.String name)
Retrieves the NamedElement with the specified 'Name' from the 'Owned Member' reference list |
EList |
getOwnedMembers()
Returns the value of the 'Owned Member' reference list. |
Constraint |
getOwnedRule(java.lang.String name)
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. |
java.util.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. |
java.util.Set |
importMembers(java.util.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,
java.util.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,
java.util.Map context)
An invariant constraint based on the following OCL expression:
membersAreDistinguishable()
|
Methods inherited from interface org.eclipse.uml2.NamedElement |
---|
allNamespaces, createDependency, createNameExpression, createNameExpression, getClientDependencies, getClientDependency, getLabel, getLabel, getName, getNameExpression, getNamespace, getQualifiedName, getVisibility, isDistinguishableFrom, qualifiedName, separator, setName, setNameExpression, setVisibility, validateNoName, validateQualifiedName, validateVisibilityNeedsOwnership |
Methods inherited from interface org.eclipse.uml2.TemplateableElement |
---|
createOwnedTemplateSignature, createOwnedTemplateSignature, createTemplateBinding, createTemplateBinding, getOwnedTemplateSignature, getTemplateBindings, parameterableElements, setOwnedTemplateSignature |
Methods inherited from interface org.eclipse.uml2.Element |
---|
addKeyword, allOwnedElements, apply, createEAnnotation, createOwnedComment, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedVersion, getKeywords, getModel, getNearestPackage, getOwnedComments, getOwnedElements, getOwner, getValue, hasKeyword, hasValue, 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 java.lang.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(java.lang.String name)
NamedElement
with the specified 'Name' from the 'Member' reference list.
name
- The '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(java.lang.String name)
Constraint
with the specified 'Name' from the 'Owned Rule' containment reference list.
name
- The '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 Constraint createOwnedRule()
Constraint
and appends it to the 'Owned Rule' containment reference list.
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(java.lang.String name)
PackageableElement
with the specified 'Name' from the 'Imported Member' reference list.
name
- The '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 ElementImport createElementImport()
ElementImport
and appends it to the 'Element Import' containment reference list.
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 PackageImport createPackageImport()
PackageImport
and appends it to the 'Package Import' containment reference list.
PackageImport
.getPackageImports()
public java.util.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, java.util.Map context)
self.importedMember->includesAll(self.importedMembers(self.elementImport.importedElement.asSet()->union(self.packageImport.importedPackage->collect(p | p.visibleMembers()))))
public java.util.Set importedMember()
self.importedMembers(self.elementImport.importedElement.asSet()->union(self.packageImport.importedPackage->collect(p | p.visibleMembers())))
public java.util.Set importMembers(java.util.Set imps)
self.excludeCollisions(imps)->select(imp | self.ownedMember->forAll(mem | mem.imp.isDistinguishableFrom(mem, self)))
public java.util.Set excludeCollisions(java.util.Set imps)
imps->reject(imp1 | imps.exists(imp2 | not imp1.isDistinguishableFrom(imp2, self)))
public EList getOwnedMembers()
NamedElement
.
It is bidirectional and its opposite is 'Namespace
'.
A collection of NamedElements owned by the Namespace. Subsets Element::ownedElement and Namespace::member. This is a derived union.
org.eclipse.uml2.UML2Package#getNamespace_OwnedMember()
,
NamedElement.getNamespace()
public NamedElement getOwnedMember(java.lang.String name)
NamedElement
with the specified 'Name' from the 'Owned Member' reference list.
name
- The 'Name' of the NamedElement
to retrieve.
NamedElement
with the specified 'Name', or null
.getOwnedMembers()
public boolean validateMembersAreDistinguishable(DiagnosticChain diagnostics, java.util.Map context)
membersAreDistinguishable()
public void importElement(VisibilityKind visibility, PackageableElement element)
visibility
- The visbility with which to import the element.element
- The element to import.
java.lang.IllegalArgumentException
- If this namespace already imports the
element.public java.util.Set getImportedPackages()
public void importPackage(VisibilityKind visibility, Package package_)
visibility
- The visbility with which to import the package.package_
- The package to import.
java.lang.IllegalArgumentException
- If this namespace already imports the
package.
|
Copyright 2003, 2005 IBM Corporation and others. All Rights Reserved. |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |