Table of Contents

Interface INamedElement

Namespace
NMF.Interop.Uml
Assembly
NMF.UMLInterop.dll

The public interface for NamedElement

[DefaultImplementationType(typeof(NamedElement))]
[XmlDefaultImplementationType(typeof(NamedElement))]
[ModelRepresentationClass("http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement")]
public interface INamedElement : IElement, IEModelElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
Inherited Members

Properties

Name

The name of the NamedElement. <p>From package UML::CommonStructure.</p>

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

Property Value

string

NameExpression

The StringExpression used to define the name of this NamedElement. <p>From package UML::CommonStructure.</p>

[Browsable(false)]
[XmlElementName("nameExpression")]
[XmlAttribute(false)]
[Containment]
IStringExpression NameExpression { get; set; }

Property Value

IStringExpression

Visibility

Determines whether and how the NamedElement is visible outside its owning Namespace. <p>From package UML::CommonStructure.</p>

[XmlElementName("visibility")]
[XmlAttribute(true)]
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 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>

IOrderedSetExpression<INamespace> AllNamespaces()

Returns

IOrderedSetExpression<INamespace>

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>

ISetExpression<IPackage> AllOwningPackages()

Returns

ISetExpression<IPackage>

CreateDependency(INamedElement)

Creates a dependency between this named element and the specified supplier, owned by this named element's nearest package.

IDependency CreateDependency(INamedElement supplier)

Parameters

supplier INamedElement

The supplier for the new dependency.

Returns

IDependency

CreateUsage(INamedElement)

Creates a usage between this named element and the specified supplier, owned by this named element's nearest package.

IUsage CreateUsage(INamedElement supplier)

Parameters

supplier INamedElement

The supplier for the new usage.

Returns

IUsage

GetClientDependencies()

result = (Dependency.allInstances()->select(d | d.client->includes(self))) <p>From package UML::CommonStructure.</p>

ISetExpression<IDependency> GetClientDependencies()

Returns

ISetExpression<IDependency>

GetLabel()

Retrieves a localized label for this named element.

string GetLabel()

Returns

string

GetLabel(bool)

Retrieves a label for this named element, localized if indicated.

string GetLabel(bool localize)

Parameters

localize bool

Whether to localize the label.

Returns

string

GetNamespace()

INamespace GetNamespace()

Returns

INamespace

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>

string GetQualifiedName()

Returns

string

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

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 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))

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 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>

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 qualifiedName. result = ('::') <p>From package UML::CommonStructure.</p>

string Separator()

Returns

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

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