Class NamedElement
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. <p>From package UML::CommonStructure.</p>
[XmlIdentifier("name")]
[XmlNamespace("http://www.eclipse.org/uml2/5.0.0/UML")]
[XmlNamespacePrefix("uml")]
[ModelRepresentationClass("http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement")]
public abstract class NamedElement : Element, INamedElement, IElement, IEModelElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
- Inheritance
-
NamedElement
- Implements
- Derived
- Inherited Members
Properties
Children
Gets the child model elements of this model element
public override IEnumerableExpression<IModelElement> Children { get; }
Property Value
ClassInstance
Gets the Class model for this type
public static IClass ClassInstance { get; }
Property Value
IsIdentified
Gets a value indicating whether the current model element can be identified by an attribute value
public override bool IsIdentified { get; }
Property Value
Name
The name of the NamedElement. <p>From package UML::CommonStructure.</p>
[XmlElementName("name")]
[Id]
[XmlAttribute(true)]
public string Name { get; set; }
Property Value
NameExpression
The StringExpression used to define the name of this NamedElement. <p>From package UML::CommonStructure.</p>
[Browsable(false)]
[XmlElementName("nameExpression")]
[XmlAttribute(false)]
[Containment]
public IStringExpression NameExpression { get; set; }
Property Value
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Visibility
Determines whether and how the NamedElement is visible outside its owning Namespace. <p>From package UML::CommonStructure.</p>
[XmlElementName("visibility")]
[XmlAttribute(true)]
public VisibilityKind? Visibility { get; set; }
Property Value
Methods
AllNamespaces()
The query allNamespaces() gives the sequence of Namespaces in which the NamedElement is nested, working outwards. result = ( if owner = null then OrderedSet{} else let enclosingNamespace : Namespace = if owner.oclIsKindOf(TemplateParameter) and owner.oclAsType(TemplateParameter).signature.template.oclIsKindOf(Namespace) then owner.oclAsType(TemplateParameter).signature.template.oclAsType(Namespace) else namespace endif in enclosingNamespace.allNamespaces()->prepend(enclosingNamespace) endif) <p>From package UML::CommonStructure.</p>
public IOrderedSetExpression<INamespace> AllNamespaces()
Returns
AllOwningPackages()
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. result = (if namespace.oclIsKindOf(Package) then let owningPackage : Package = namespace.oclAsType(Package) in owningPackage->union(owningPackage.allOwningPackages()) else null endif) <p>From package UML::CommonStructure.</p>
public ISetExpression<IPackage> AllOwningPackages()
Returns
CreateDependency(INamedElement)
Creates a dependency between this named element and the specified supplier, owned by this named element's nearest package.
public IDependency CreateDependency(INamedElement supplier)
Parameters
supplier
INamedElementThe supplier for the new dependency.
Returns
CreateUsage(INamedElement)
Creates a usage between this named element and the specified supplier, owned by this named element's nearest package.
public IUsage CreateUsage(INamedElement supplier)
Parameters
supplier
INamedElementThe supplier for the new usage.
Returns
GetAttributeValue(string, int)
Resolves the given attribute name
protected override object GetAttributeValue(string attribute, int index)
Parameters
Returns
- object
The attribute value or null if it could not be found
GetClass()
Gets the Class for this model element
public override IClass GetClass()
Returns
GetClientDependencies()
result = (Dependency.allInstances()->select(d | d.client->includes(self))) <p>From package UML::CommonStructure.</p>
public ISetExpression<IDependency> GetClientDependencies()
Returns
GetExpressionForAttribute(string)
Gets the property expression for the given attribute
protected override INotifyExpression<object> GetExpressionForAttribute(string attribute)
Parameters
attribute
stringThe requested attribute in upper case
Returns
- INotifyExpression<object>
An incremental property expression
GetExpressionForReference(string)
Gets the property expression for the given reference
protected override INotifyExpression<IModelElement> GetExpressionForReference(string reference)
Parameters
reference
stringThe requested reference in upper case
Returns
- INotifyExpression<IModelElement>
An incremental property expression
GetLabel()
Retrieves a localized label for this named element.
public string GetLabel()
Returns
GetLabel(bool)
Retrieves a label for this named element, localized if indicated.
public string GetLabel(bool localize)
Parameters
localize
boolWhether to localize the label.
Returns
GetModelElementForReference(string, int)
Resolves the given URI to a child model element
protected override IModelElement GetModelElementForReference(string reference, int index)
Parameters
Returns
- IModelElement
The model element or null if it could not be found
GetNamespace()
public INamespace GetNamespace()
Returns
GetQualifiedName()
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. 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) <p>From package UML::CommonStructure.</p>
public string GetQualifiedName()
Returns
GetRelativePathForNonIdentifiedChild(IModelElement)
Gets the relative URI fragment for the given child model element
protected override string GetRelativePathForNonIdentifiedChild(IModelElement element)
Parameters
element
IModelElementThe element that should be looked for
Returns
- string
A fragment of the relative URI
Has_no_qualified_name(object, object)
If there is no name, or one of the containing Namespaces has no name, there is no qualifiedName. name=null or allNamespaces()->select( ns | ns.name=null )->notEmpty() implies qualifiedName = null
public bool Has_no_qualified_name(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
Has_qualified_name(object, object)
When there is a name, and all of the containing Namespaces have a name, the qualifiedName is constructed from the name of the NamedElement and the names of the containing Namespaces. (name <> null and allNamespaces()->select(ns | ns.name = null)->isEmpty()) implies qualifiedName = allNamespaces()->iterate( ns : Namespace; agg: String = name | ns.name.concat(self.separator()).concat(agg))
public bool Has_qualified_name(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
IsDistinguishableFrom(INamedElement, INamespace)
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. result = ((self.oclIsKindOf(n.oclType()) or n.oclIsKindOf(self.oclType())) implies ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->isEmpty() ) <p>From package UML::CommonStructure.</p>
public bool IsDistinguishableFrom(INamedElement n, INamespace ns)
Parameters
n
INamedElementns
INamespace
Returns
Separator()
The query separator() gives the string that is used to separate names when constructing a qualifiedName. result = ('::') <p>From package UML::CommonStructure.</p>
public string Separator()
Returns
SetFeature(string, object)
Sets a value to the given feature
protected override void SetFeature(string feature, object value)
Parameters
ToIdentifierString()
Gets the identifier string for this model element
public override string ToIdentifierString()
Returns
- string
The identifier string
Visibility_needs_ownership(object, object)
If a NamedElement is owned by something other than a Namespace, it does not have a visibility. One that is not owned by anything (and hence must be a Package, as this is the only kind of NamedElement that overrides mustBeOwned()) may have a visibility. (namespace = null and owner <> null) implies visibility = null
public bool Visibility_needs_ownership(object diagnostics, object context)
Parameters
diagnostics
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.