Interface INamedElement
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
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
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
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
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
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
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.
IUsage CreateUsage(INamedElement supplier)
Parameters
supplier
INamedElementThe supplier for the new usage.
Returns
GetClientDependencies()
result = (Dependency.allInstances()->select(d | d.client->includes(self))) <p>From package UML::CommonStructure.</p>
ISetExpression<IDependency> GetClientDependencies()
Returns
GetLabel()
Retrieves a localized label for this named element.
string GetLabel()
Returns
GetLabel(bool)
Retrieves a label for this named element, localized if indicated.
string GetLabel(bool localize)
Parameters
localize
boolWhether to localize the label.
Returns
GetNamespace()
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>
string GetQualifiedName()
Returns
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
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))
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>
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>
string Separator()
Returns
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
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.