|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A representation of the model object 'Element'. Element is an abstract metaclass with no superclass. It is used as the common superclass for all metaclasses in the infrastructure library. Element has a derived composition association to itself to support the general capability for elements to own other elements.
The following features are supported:
UML2Package.getElement()
Field Summary | |
static String |
copyright
|
Method Summary | |
void |
addKeyword(String keyword)
Adds the specified keyword to this element. |
Set |
allOwnedElements()
A query based on the following OCL expression:
ownedElement->union(ownedElement->collect(e | e.allOwnedElements()))
|
void |
apply(Stereotype stereotype)
Applies the specified stereotype to this element. |
EAnnotation |
createEAnnotation(String source)
Creates an EAnnotation with the specified
source and this element as its Ecore model element.
|
Comment |
createOwnedComment(EClass eClass)
Creates a Comment and appends it to the 'Owned Comment' containment reference list |
void |
destroy()
Destroys this element by removing all usage cross references to it (from within its resource set) and removing it from its containing resource or object. |
Stereotype |
getApplicableStereotype(String qualifiedStereotypeName)
Retrieves the stereotype with the specified qualified name that is applicable to this element, or null if no such stereotype
exists. |
Set |
getApplicableStereotypes()
Retrieves the set of stereotypes that are applicable to this element, including those are required and/or may already be applied. |
Stereotype |
getAppliedStereotype(String qualifiedStereotypeName)
Retrieves the stereotype with the specified qualified name that is applied to this element, or null if no such stereotype is
applied. |
Set |
getAppliedStereotypes()
Retrieves the set of stereotypes applied to this element. |
String |
getAppliedVersion(Stereotype stereotype)
Retrieves the version of the specified stereotype that is applied to this element. |
Set |
getKeywords()
Retrieves the set of keywords for this element. |
Model |
getModel()
Retrieves the model that contains (either directly or indirectly) this element. |
Package |
getNearestPackage()
Retrieves the nearest package that contains (either directly or indirectly) this element, or the element itself (if it is a package). |
EList |
getOwnedComments()
Returns the value of the 'Owned Comment' containment reference list. |
EList |
getOwnedElements()
Returns the value of the 'Owned Element' reference list. |
Element |
getOwner()
Returns the value of the 'Owner' reference. |
Object |
getValue(Stereotype stereotype,
String propertyName)
Retrieves the value of the property with the specified name from the specified stereotype application for this element. |
boolean |
hasKeyword(String keyword)
Determines whether this element has the specified keyword. |
boolean |
isApplied(Stereotype stereotype)
Determines whether the specified stereotype is applied to this element. |
boolean |
isRequired(Stereotype stereotype)
Determines whether the specified stereotype is required for this element. |
boolean |
mustBeOwned()
A query based on the following OCL expression:
true
|
void |
removeKeyword(String keyword)
Removes the specified keyword from this element. |
void |
setValue(Stereotype stereotype,
String propertyName,
Object value)
Sets the value of the property with the specified name in the specified stereotype application for this element. |
void |
unapply(Stereotype stereotype)
Unapplies the specified stereotype from this element. |
boolean |
validateHasOwner(DiagnosticChain diagnostics,
Map context)
An invariant constraint based on the following OCL expression:
self.mustBeOwned() implies owner->notEmpty()
|
boolean |
validateNotOwnSelf(DiagnosticChain diagnostics,
Map context)
An invariant constraint based on the following OCL expression:
not self.allOwnedElements()->includes(self)
|
Methods inherited from interface org.eclipse.emf.ecore.EModelElement |
getEAnnotation, getEAnnotations |
Methods inherited from interface org.eclipse.emf.ecore.EObject |
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset |
Methods inherited from interface org.eclipse.emf.common.notify.Notifier |
eAdapters, eDeliver, eNotify, eSetDeliver |
Field Detail |
public static final String copyright
Method Detail |
public EList getOwnedElements()
Element
.
It is bidirectional and its opposite is 'Owner
'.
If the meaning of the 'Owned Element' reference list isn't clear, there really should be more of a description here...
The Elements owned by this element. This is a derived union.
UML2Package.getElement_OwnedElement()
,
getOwner()
public Element getOwner()
Owned Element
'.
If the meaning of the 'Owner' reference isn't clear, there really should be more of a description here...
The Element that owns this element. This is a derived union.
UML2Package.getElement_Owner()
,
getOwnedElements()
public EList getOwnedComments()
Comment
.
If the meaning of the 'Owned Comment' containment reference list isn't clear, there really should be more of a description here...
The Comments owned by this element. Subsets Element::ownedElement.
UML2Package.getElement_OwnedComment()
public Comment createOwnedComment(EClass eClass)
Comment
and appends it to the 'Owned Comment' containment reference list.
eClass
- The Ecore class of the Comment
to create.
Comment
.getOwnedComments()
public boolean validateNotOwnSelf(DiagnosticChain diagnostics, Map context)
not self.allOwnedElements()->includes(self)
public boolean validateHasOwner(DiagnosticChain diagnostics, Map context)
self.mustBeOwned() implies owner->notEmpty()
public Set allOwnedElements()
ownedElement->union(ownedElement->collect(e | e.allOwnedElements()))
public boolean mustBeOwned()
true
public EAnnotation createEAnnotation(String source)
EAnnotation
with the specified
source and this element as its Ecore model element.
source
- The source of the EAnnotation
to
create.
EAnnotation
.EModelElement.getEAnnotations()
public boolean isApplied(Stereotype stereotype)
stereotype
- The stereotype to test for application.
true
if the stereotype is applied to this element;
false
otherwise.public boolean isRequired(Stereotype stereotype)
stereotype
- The stereotype to test for requirement.
true
if the stereotype is required for this
element; false
otherwise.public Set getApplicableStereotypes()
public Stereotype getApplicableStereotype(String qualifiedStereotypeName)
null
if no such stereotype
exists.
qualifiedStereotypeName
- The qualified name of the applicable stereotype to retrieve.
public Set getAppliedStereotypes()
public Stereotype getAppliedStereotype(String qualifiedStereotypeName)
null
if no such stereotype is
applied.
qualifiedStereotypeName
- The qualified name of the applied stereotype to retrieve.
public void apply(Stereotype stereotype)
stereotype
- The stereotype to be applied.
IllegalArgumentException
- If the stereotype is already applied or is not applicable to
this element.public void unapply(Stereotype stereotype)
stereotype
- The stereotype to be unapplied.
IllegalArgumentException
- If the stereotype is required or is not applied to this
element.public Object getValue(Stereotype stereotype, String propertyName)
stereotype
- The stereotype whose application contains the property.propertyName
- The name of the property whose value to retrieve.
IllegalArgumentException
- If the stereotype is not applied to this element or the
property does not exist.public void setValue(Stereotype stereotype, String propertyName, Object value)
stereotype
- The stereotype whose application contains the property.propertyName
- The name of the property whose value to set.value
- The new value of the applied stereotype property.
IllegalArgumentException
- If the stereotype is not applied to this element or the
property does not exist.public Model getModel()
null
.public Package getNearestPackage()
null
.public void destroy()
Note that this operation can be expensive (since it traverses all containment hierarchies) and doesn't guarantee that all references will be removed (since references can exist in other resources that don't belong to the same resource set).
public String getAppliedVersion(Stereotype stereotype)
stereotype
- The stereotype whose applied version to retrieve.
null
if not
applied.public Set getKeywords()
public boolean hasKeyword(String keyword)
keyword
- The keyword in question.
true
if this element has the specified keyword;
false
otherwise.public void addKeyword(String keyword)
keyword
- The keyword to be added.
IllegalArgumentException
- If the keyword is invalid (i.e. empty).public void removeKeyword(String keyword)
keyword
- The keyword to be removed.
IllegalArgumentException
- If this element does not have the keyword.
|
Copyright 2003, 2004 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |