Class Element
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
ClassInstance
Gets the Class model for this type
public static IClass ClassInstance { get; }
Property Value
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
ReferencedElements
Gets the referenced model elements of this model element
public override IEnumerableExpression<IModelElement> ReferencedElements { get; }
Property Value
Methods
AddKeyword(string)
Adds the specified keyword to this element.
public bool AddKeyword(string keyword)
Parameters
keyword
stringThe keyword to add.
Returns
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
ApplyStereotype(IStereotype)
Applies the specified stereotype to this element.
public IEObject ApplyStereotype(IStereotype stereotype)
Parameters
stereotype
IStereotypeThe stereotype to apply.
Returns
CreateEAnnotation(string)
Creates an annotation with the specified source and this element as its model element.
public IEAnnotation CreateEAnnotation(string source)
Parameters
source
stringThe source for the new annotation.
Returns
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
stringThe qualified name of the applicable stereotype to retrieve.
Returns
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
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
stringThe qualified name of the applied stereotype to retrieve.
Returns
GetAppliedStereotypes()
Retrieves the stereotypes that are applied to this element.
public ISetExpression<IStereotype> GetAppliedStereotypes()
Returns
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
IStereotypeThe superstereotype of the applied substereotype to retrieve.
qualifiedName
stringThe qualified name of the applied substereotype to retrieve.
Returns
GetAppliedSubstereotypes(IStereotype)
Retrieves the substereotypes of the specified stereotype that are applied to this element.
public ISetExpression<IStereotype> GetAppliedSubstereotypes(IStereotype stereotype)
Parameters
stereotype
IStereotypeThe superstereotype of the applied substereotypes to retrieve.
Returns
GetClass()
Gets the Class for this model element
public override IClass GetClass()
Returns
GetCollectionForFeature(string)
Gets the Model element collection for the given feature
protected override IList GetCollectionForFeature(string feature)
Parameters
feature
stringThe 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
objectThe container object
Returns
- string
The name of the respective container reference
GetKeywords()
Retrieves the keywords for this element.
public ISetExpression<string> GetKeywords()
Returns
GetModel()
Retrieves the model that owns (either directly or indirectly) this element.
public IModel GetModel()
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
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
GetRelationships()
Retrieves the relationships in which this element is involved.
public ISetExpression<IRelationship> GetRelationships()
Returns
GetRelationships(IEClass)
Retrieves the relationships of the specified type in which this element is involved.
public ISetExpression<IRelationship> GetRelationships(IEClass eClass)
Parameters
eClass
IEClassThe (meta)type of the relationships to retrieve.
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
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
stringThe qualified name of the required stereotype to retrieve.
Returns
GetRequiredStereotypes()
Retrieves the stereotypes that are required for this element.
public ISetExpression<IStereotype> GetRequiredStereotypes()
Returns
GetSourceDirectedRelationships()
Retrieves the directed relationships for which this element is a source.
public ISetExpression<IDirectedRelationship> GetSourceDirectedRelationships()
Returns
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
IEClassThe (meta)type of the directed relationships to retrieve.
Returns
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
IStereotypeThe stereotype for which to retrieve an application.
Returns
GetStereotypeApplications()
Retrieves the stereotype applications for this element.
public ISetExpression<IEObject> GetStereotypeApplications()
Returns
GetTargetDirectedRelationships()
Retrieves the directed relationships for which this element is a target.
public ISetExpression<IDirectedRelationship> GetTargetDirectedRelationships()
Returns
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
IEClassThe (meta)type of the directed relationships to retrieve.
Returns
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
IStereotypeThe stereotype for which to retrieve the value.
propertyName
stringThe name of the property whose value to retrieve.
Returns
HasKeyword(string)
Determines whether this element has the specified keyword.
public bool HasKeyword(string keyword)
Parameters
keyword
stringThe keyword in question.
Returns
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
IStereotypeThe stereotype for which to test the property.
propertyName
stringThe name of the property in question.
Returns
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
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
IsStereotypeApplicable(IStereotype)
Determines whether the specified stereotype is applicable to this element.
public bool IsStereotypeApplicable(IStereotype stereotype)
Parameters
stereotype
IStereotypeThe stereotype in question.
Returns
IsStereotypeApplied(IStereotype)
Determines whether the specified stereotype is applied to this element.
public bool IsStereotypeApplied(IStereotype stereotype)
Parameters
stereotype
IStereotypeThe stereotype in question.
Returns
IsStereotypeRequired(IStereotype)
Determines whether the specified stereotype is required for this element.
public bool IsStereotypeRequired(IStereotype stereotype)
Parameters
stereotype
IStereotypeThe stereotype in question.
Returns
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
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
objectThe chain of diagnostics to which problems are to be appended.
context
objectThe cache of context-specific information.
Returns
RemoveKeyword(string)
Removes the specified keyword from this element.
public bool RemoveKeyword(string keyword)
Parameters
keyword
stringThe keyword to remove.
Returns
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
IStereotypeThe stereotype for which to set the value.
propertyName
stringThe name of the property whose value to set.
newValue
objectThe new value for the property.
UnapplyStereotype(IStereotype)
Unapplies the specified stereotype from this element.
public IEObject UnapplyStereotype(IStereotype stereotype)
Parameters
stereotype
IStereotypeThe stereotype to unapply.