Table of Contents

Class Element

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

An Element is a constituent of a model. As such, it has the capability of owning other Elements. <p>From package UML::CommonStructure.</p>

[XmlNamespace("http://www.eclipse.org/uml2/5.0.0/UML")]
[XmlNamespacePrefix("uml")]
[ModelRepresentationClass("http://www.eclipse.org/uml2/5.0.0/UML#//Element")]
public abstract class Element : EModelElement, IElement, IEModelElement, IModelElement, INotifyPropertyChanged, INotifyPropertyChanging
Inheritance
Element
Implements
Derived
Inherited Members

Constructors

Element()

Creates a new instance

public Element()

Properties

Children

Gets the child model elements of this model element

public override IEnumerableExpression<IModelElement> Children { get; }

Property Value

IEnumerableExpression<IModelElement>

ClassInstance

Gets the Class model for this type

public static IClass ClassInstance { get; }

Property Value

IClass

OwnedComment

The Comments owned by this Element. <p>From package UML::CommonStructure.</p>

[Browsable(false)]
[XmlElementName("ownedComment")]
[XmlAttribute(false)]
[Containment]
public IOrderedSetExpression<IComment> OwnedComment { get; }

Property Value

IOrderedSetExpression<IComment>

ReferencedElements

Gets the referenced model elements of this model element

public override IEnumerableExpression<IModelElement> ReferencedElements { get; }

Property Value

IEnumerableExpression<IModelElement>

Methods

AddKeyword(string)

Adds the specified keyword to this element.

public bool AddKeyword(string keyword)

Parameters

keyword string

The keyword to add.

Returns

bool

AllOwnedElements()

The query allOwnedElements() gives all of the direct and indirect ownedElements of an Element. result = (ownedElement->union(ownedElement->collect(e | e.allOwnedElements()))->asSet()) <p>From package UML::CommonStructure.</p>

public ISetExpression<IElement> AllOwnedElements()

Returns

ISetExpression<IElement>

ApplyStereotype(IStereotype)

Applies the specified stereotype to this element.

public IEObject ApplyStereotype(IStereotype stereotype)

Parameters

stereotype IStereotype

The stereotype to apply.

Returns

IEObject

CreateEAnnotation(string)

Creates an annotation with the specified source and this element as its model element.

public IEAnnotation CreateEAnnotation(string source)

Parameters

source string

The source for the new annotation.

Returns

IEAnnotation

Destroy()

Destroys this element by removing all cross references to/from it and removing it from its containing resource or object.

public void Destroy()

GetApplicableStereotype(string)

Retrieves the stereotype with the specified qualified name that is applicable to this element, or null if no such stereotype is applicable.

public IStereotype GetApplicableStereotype(string qualifiedName)

Parameters

qualifiedName string

The qualified name of the applicable stereotype to retrieve.

Returns

IStereotype

GetApplicableStereotypes()

Retrieves the stereotypes that are applicable to this element, including those that are required and/or may already be applied.

public ISetExpression<IStereotype> GetApplicableStereotypes()

Returns

ISetExpression<IStereotype>

GetAppliedStereotype(string)

Retrieves the stereotype with the specified qualified name that is applied to this element, or null if no such stereotype is applied.

public IStereotype GetAppliedStereotype(string qualifiedName)

Parameters

qualifiedName string

The qualified name of the applied stereotype to retrieve.

Returns

IStereotype

GetAppliedStereotypes()

Retrieves the stereotypes that are applied to this element.

public ISetExpression<IStereotype> GetAppliedStereotypes()

Returns

ISetExpression<IStereotype>

GetAppliedSubstereotype(IStereotype, string)

Retrieves the substereotype of the specified stereotype with the specified qualified name that is applied to this element, or null if no such stereotype is applied.

public IStereotype GetAppliedSubstereotype(IStereotype stereotype, string qualifiedName)

Parameters

stereotype IStereotype

The superstereotype of the applied substereotype to retrieve.

qualifiedName string

The qualified name of the applied substereotype to retrieve.

Returns

IStereotype

GetAppliedSubstereotypes(IStereotype)

Retrieves the substereotypes of the specified stereotype that are applied to this element.

public ISetExpression<IStereotype> GetAppliedSubstereotypes(IStereotype stereotype)

Parameters

stereotype IStereotype

The superstereotype of the applied substereotypes to retrieve.

Returns

ISetExpression<IStereotype>

GetClass()

Gets the Class for this model element

public override IClass GetClass()

Returns

IClass

GetCollectionForFeature(string)

Gets the Model element collection for the given feature

protected override IList GetCollectionForFeature(string feature)

Parameters

feature string

The requested feature

Returns

IList

A non-generic list of elements

GetCompositionName(object)

Gets the property name for the given container

protected override string GetCompositionName(object container)

Parameters

container object

The container object

Returns

string

The name of the respective container reference

GetKeywords()

Retrieves the keywords for this element.

public ISetExpression<string> GetKeywords()

Returns

ISetExpression<string>

GetModel()

Retrieves the model that owns (either directly or indirectly) this element.

public IModel GetModel()

Returns

IModel

GetModelElementForReference(string, int)

Resolves the given URI to a child model element

protected override IModelElement GetModelElementForReference(string reference, int index)

Parameters

reference string

The requested reference name

index int

The index of this reference

Returns

IModelElement

The model element or null if it could not be found

GetNearestPackage()

Retrieves the nearest package that owns (either directly or indirectly) this element, or the element itself (if it is a package).

public IPackage GetNearestPackage()

Returns

IPackage

GetRelationships()

Retrieves the relationships in which this element is involved.

public ISetExpression<IRelationship> GetRelationships()

Returns

ISetExpression<IRelationship>

GetRelationships(IEClass)

Retrieves the relationships of the specified type in which this element is involved.

public ISetExpression<IRelationship> GetRelationships(IEClass eClass)

Parameters

eClass IEClass

The (meta)type of the relationships to retrieve.

Returns

ISetExpression<IRelationship>

GetRelativePathForNonIdentifiedChild(IModelElement)

Gets the relative URI fragment for the given child model element

protected override string GetRelativePathForNonIdentifiedChild(IModelElement element)

Parameters

element IModelElement

The element that should be looked for

Returns

string

A fragment of the relative URI

GetRequiredStereotype(string)

Retrieves the stereotype with the specified qualified name that is required for this element, or null if no such stereotype is required.

public IStereotype GetRequiredStereotype(string qualifiedName)

Parameters

qualifiedName string

The qualified name of the required stereotype to retrieve.

Returns

IStereotype

GetRequiredStereotypes()

Retrieves the stereotypes that are required for this element.

public ISetExpression<IStereotype> GetRequiredStereotypes()

Returns

ISetExpression<IStereotype>

GetSourceDirectedRelationships()

Retrieves the directed relationships for which this element is a source.

public ISetExpression<IDirectedRelationship> GetSourceDirectedRelationships()

Returns

ISetExpression<IDirectedRelationship>

GetSourceDirectedRelationships(IEClass)

Retrieves the directed relationships of the specified type for which this element is a source.

public ISetExpression<IDirectedRelationship> GetSourceDirectedRelationships(IEClass eClass)

Parameters

eClass IEClass

The (meta)type of the directed relationships to retrieve.

Returns

ISetExpression<IDirectedRelationship>

GetStereotypeApplication(IStereotype)

Retrieves the application of the specified stereotype for this element, or null if no such stereotype application exists.

public IEObject GetStereotypeApplication(IStereotype stereotype)

Parameters

stereotype IStereotype

The stereotype for which to retrieve an application.

Returns

IEObject

GetStereotypeApplications()

Retrieves the stereotype applications for this element.

public ISetExpression<IEObject> GetStereotypeApplications()

Returns

ISetExpression<IEObject>

GetTargetDirectedRelationships()

Retrieves the directed relationships for which this element is a target.

public ISetExpression<IDirectedRelationship> GetTargetDirectedRelationships()

Returns

ISetExpression<IDirectedRelationship>

GetTargetDirectedRelationships(IEClass)

Retrieves the directed relationships of the specified type for which this element is a target.

public ISetExpression<IDirectedRelationship> GetTargetDirectedRelationships(IEClass eClass)

Parameters

eClass IEClass

The (meta)type of the directed relationships to retrieve.

Returns

ISetExpression<IDirectedRelationship>

GetValue(IStereotype, string)

Retrieves the value of the property with the specified name in the specified stereotype for this element.

public object GetValue(IStereotype stereotype, string propertyName)

Parameters

stereotype IStereotype

The stereotype for which to retrieve the value.

propertyName string

The name of the property whose value to retrieve.

Returns

object

HasKeyword(string)

Determines whether this element has the specified keyword.

public bool HasKeyword(string keyword)

Parameters

keyword string

The keyword in question.

Returns

bool

HasValue(IStereotype, string)

Determines whether this element has a (non-default) value for the property with the specified name in the specified stereotype.

public bool HasValue(IStereotype stereotype, string propertyName)

Parameters

stereotype IStereotype

The stereotype for which to test the property.

propertyName string

The name of the property in question.

Returns

bool

Has_owner(object, object)

Elements that must be owned must have an owner. mustBeOwned() implies owner->notEmpty()

public bool Has_owner(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

IsStereotypeApplicable(IStereotype)

Determines whether the specified stereotype is applicable to this element.

public bool IsStereotypeApplicable(IStereotype stereotype)

Parameters

stereotype IStereotype

The stereotype in question.

Returns

bool

IsStereotypeApplied(IStereotype)

Determines whether the specified stereotype is applied to this element.

public bool IsStereotypeApplied(IStereotype stereotype)

Parameters

stereotype IStereotype

The stereotype in question.

Returns

bool

IsStereotypeRequired(IStereotype)

Determines whether the specified stereotype is required for this element.

public bool IsStereotypeRequired(IStereotype stereotype)

Parameters

stereotype IStereotype

The stereotype in question.

Returns

bool

MustBeOwned()

The query mustBeOwned() indicates whether Elements of this type must have an owner. Subclasses of Element that do not require an owner must override this operation. result = (true) <p>From package UML::CommonStructure.</p>

public bool MustBeOwned()

Returns

bool

Not_own_self(object, object)

An element may not directly or indirectly own itself. not allOwnedElements()->includes(self)

public bool Not_own_self(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

RemoveKeyword(string)

Removes the specified keyword from this element.

public bool RemoveKeyword(string keyword)

Parameters

keyword string

The keyword to remove.

Returns

bool

SetValue(IStereotype, string, object)

Sets the value of the property with the specified name in the specified stereotype for this element.

public void SetValue(IStereotype stereotype, string propertyName, object newValue)

Parameters

stereotype IStereotype

The stereotype for which to set the value.

propertyName string

The name of the property whose value to set.

newValue object

The new value for the property.

UnapplyStereotype(IStereotype)

Unapplies the specified stereotype from this element.

public IEObject UnapplyStereotype(IStereotype stereotype)

Parameters

stereotype IStereotype

The stereotype to unapply.

Returns

IEObject