Software Disclaimer

Abstract Class UML 2.5::NamedElement

Description:

A NamedElement is an Element in a model that may have a name. The name may be given directly and/or via the use of a StringExpression.

Direct Superclasses: Element

Direct Subclasses: Vertex, TypedElement, Trigger, RedefinableElement, ParameterSet, PackageableElement, Namespace, MessageEnd, Message, Lifeline, InteractionFragment, Include, GeneralOrdering, Extend, DeploymentTarget, DeployedArtifact, CollaborationUse, ActivityGroup

Class Precedence List: NamedElement, Element

Properties:

clientDependency : Dependency (0 *); -- source NamedElement
name : String (0 1); -- source NamedElement
nameExpression : StringExpression (0 1); -- source NamedElement
namespace : Namespace (0 1); -- source NamedElement
qualifiedName : String (0 1); -- source NamedElement
visibility : VisibilityKind (0 1); -- source NamedElement

Determines whether and how the NamedElement is visible outside its owning Namespace.

ownedComment : Comment (0 *); -- source Element
ownedElement : Element (0 *); -- source Element
owner : Element (0 1); -- source Element

Constraints:

Signature: CMOF_14_3_7a() : Boolean;
Description: 14.3 [7] CMOF does not support visibilities. All property visibilities must be explicitly set to public where applicable, that is for all NamedElements, ElementImports and PackageImports. Furthermore, no alias is allowed for any ElementImport. see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/named-element-is-not-public
Expression: visibility = VisibilityKind::public

Signature: CMOF_14_3_6() : Boolean;
Description: 14.3 [6] Names are required for all NamedElements except for ValueSpecifications. see also: https://sites.google.com/site/metamodelingantipatterns/catalog/mof/named-element-has-no-name
Expression: not oclIsKindOf(ValueSpecification) implies (name <> null and name->notEmpty())

Operations:

Signature: separator() : String;
Description: The query separator() gives the string that is used to separate names when constructing a qualifiedName.
Expression: result = ('::')

Signature: qualifiedName.1() : String;
Description: When a NamedElement has a name, and all of its containing Namespaces have a name, the qualifiedName is constructed from the name of the NamedElement and the names of the containing Namespaces.
Expression: result = (if self.name <> null and self.allNamespaces()->select( ns | ns.name=null )->isEmpty() then self.allNamespaces()->iterate( ns : Namespace; agg: String = self.name | ns.name.concat(self.separator()).concat(agg)) else null endif)

Signature: isDistinguishableFrom(n : NamedElement; ns : Namespace; ) : Boolean;
Description: The query isDistinguishableFrom() determines whether two NamedElements may logically co-exist within a Namespace. By default, two named elements are distinguishable if (a) they have types neither of which is a kind of the other or (b) they have different names.
Expression: result = ((self.oclIsKindOf(n.oclType()) or n.oclIsKindOf(self.oclType())) implies ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->isEmpty() )

Signature: clientDependency.1() : Dependency;
Description:
Expression: result = (Dependency.allInstances()->select(d | d.client->includes(self)))

Signature: allOwningPackages() : Package;
Description: The query allOwningPackages() returns the set of all the enclosing Namespaces of this NamedElement, working outwards, that are Packages, up to but not including the first such Namespace that is not a Package.
Expression: result = (if namespace.oclIsKindOf(Package) then let owningPackage : Package = namespace.oclAsType(Package) in owningPackage->union(owningPackage.allOwningPackages()) else null endif)

Signature: allNamespaces() : Namespace;
Description: The query allNamespaces() gives the sequence of Namespaces in which the NamedElement is nested, working outwards.
Expression: result = (if owner.oclIsKindOf(TemplateParameter) and owner.oclAsType(TemplateParameter).signature.template.oclIsKindOf(Namespace) then let enclosingNamespace : Namespace = owner.oclAsType(TemplateParameter).signature.template.oclAsType(Namespace) in enclosingNamespace.allNamespaces()->prepend(enclosingNamespace) else if namespace->isEmpty() then OrderedSet{} else namespace.allNamespaces()->prepend(namespace) endif endif)



Send questions or comments to xmi-interop@omg.org.