Table of Contents

Class NamedElement

Namespace
NMF.Interop.Cmof
Assembly
NMF.UMLInterop.dll

A named element is an element in a model that may have a name.

[XmlIdentifier("name")]
[XmlNamespace("http://www.omg.org/spec/MOF/20131001/cmof.xmi")]
[XmlNamespacePrefix("cmof")]
[ModelRepresentationClass("http://www.omg.org/spec/MOF/20131001/cmof.xmi#//NamedElement")]
public abstract class NamedElement : Element, INamedElement, IElement, IObject, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
Inheritance
NamedElement
Implements
Derived
Inherited Members

Properties

ClassInstance

Gets the Class model for this type

public static IClass ClassInstance { get; }

Property Value

IClass

IsIdentified

Gets a value indicating whether the current model element can be identified by an attribute value

public override bool IsIdentified { get; }

Property Value

bool

Name

The name of the NamedElement.

[XmlElementName("name")]
[Id]
[XmlAttribute(true)]
public string Name { get; set; }

Property Value

string

Visibility

Determines where the NamedElement appears within different Namespaces within the overall model, and its accessibility.

[XmlElementName("visibility")]
[XmlAttribute(true)]
public VisibilityKind? Visibility { get; set; }

Property Value

VisibilityKind?

Methods

AllNamespaces()

The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards. result = if self.namespace->isEmpty() then Sequence{} else self.namespace.allNamespaces()->prepend(self.namespace) endif

public IOrderedSetExpression<INamespace> AllNamespaces()

Returns

IOrderedSetExpression<INamespace>

GetAttributeValue(string, int)

Resolves the given attribute name

protected override object GetAttributeValue(string attribute, int index)

Parameters

attribute string

The requested attribute name

index int

The index of this attribute

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

IClass

GetExpressionForAttribute(string)

Gets the property expression for the given attribute

protected override INotifyExpression<object> GetExpressionForAttribute(string attribute)

Parameters

attribute string

The requested attribute in upper case

Returns

INotifyExpression<object>

An incremental property expression

Has_no_qualified_name(object, object)

If there is no name, or one of the containing namespaces has no name, there is no qualified name. (self.name->isEmpty() or self.allNamespaces()->select(ns | ns.name->isEmpty())->notEmpty()) implies self.qualifiedName->isEmpty()

public bool Has_no_qualified_name(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

Has_qualified_name(object, object)

When there is a name, and all of the containing namespaces have a name, the qualified name is constructed from the names of the containing namespaces. (self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty()) implies self.qualifiedName = self.allNamespaces()->iterate( ns : Namespace; result: String = self.name | ns.name->union(self.separator())->union(result))

public bool Has_qualified_name(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool

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 unrelated types or (b) they have related types but different names. result = if self.oclIsKindOf(n.oclType) or n.oclIsKindOf(self.oclType) then ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->isEmpty() else true endif

public bool IsDistinguishableFrom(INamedElement n, INamespace ns)

Parameters

n INamedElement
ns INamespace

Returns

bool

Separator()

The query separator() gives the string that is used to separate names when constructing a qualified name. result = '::'

public string Separator()

Returns

string

SetFeature(string, object)

Sets a value to the given feature

protected override void SetFeature(string feature, object value)

Parameters

feature string

The requested feature

value object

The value that should be set to that feature

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 not owned by a Namespace, it does not have a visibility. namespace->isEmpty() implies visibility->isEmpty()

public bool Visibility_needs_ownership(object diagnostics, object context)

Parameters

diagnostics object

The chain of diagnostics to which problems are to be appended.

context object

The cache of context-specific information.

Returns

bool