org.eclipse.uml2
Interface Element

All Superinterfaces:
EModelElement, EObject, Notifier
All Known Subinterfaces:
Abstraction, AcceptCallAction, AcceptEventAction, Action, Activity, ActivityEdge, ActivityFinalNode, ActivityGroup, ActivityNode, ActivityParameterNode, ActivityPartition, Actor, AddStructuralFeatureValueAction, AddVariableValueAction, AnyTrigger, ApplyFunctionAction, Artifact, Association, AssociationClass, Behavior, BehavioralFeature, BehavioredClassifier, BroadcastSignalAction, CallAction, CallBehaviorAction, CallOperationAction, CallTrigger, CentralBufferNode, ChangeTrigger, Class, Classifier, ClassifierTemplateParameter, Clause, ClearAssociationAction, ClearStructuralFeatureAction, ClearVariableAction, Collaboration, CollaborationOccurrence, CombinedFragment, Comment, CommunicationPath, Component, ConditionalNode, ConnectableElement, ConnectableElementTemplateParameter, ConnectionPointReference, Connector, ConnectorEnd, Constraint, Continuation, ControlFlow, ControlNode, CreateLinkAction, CreateLinkObjectAction, CreateObjectAction, DataStoreNode, DataType, DecisionNode, Dependency, DeployedArtifact, Deployment, DeploymentSpecification, DeploymentTarget, DestroyLinkAction, DestroyObjectAction, Device, DirectedRelationship, Duration, DurationConstraint, DurationInterval, DurationObservationAction, ElementImport, EncapsulatedClassifier, Enumeration, EnumerationLiteral, EventOccurrence, ExceptionHandler, ExecutableNode, ExecutionEnvironment, ExecutionOccurrence, ExpansionNode, ExpansionRegion, Expression, Extend, Extension, ExtensionEnd, ExtensionPoint, Feature, FinalNode, FinalState, FlowFinalNode, ForkNode, Gate, Generalization, GeneralizationSet, GeneralOrdering, Implementation, Include, InformationFlow, InformationItem, InitialNode, InputPin, InstanceSpecification, InstanceValue, Interaction, InteractionConstraint, InteractionFragment, InteractionOccurrence, InteractionOperand, Interface, InterruptibleActivityRegion, Interval, IntervalConstraint, InvocationAction, JoinNode, Lifeline, LinkAction, LinkEndCreationData, LinkEndData, LiteralBoolean, LiteralInteger, LiteralNull, LiteralSpecification, LiteralString, LiteralUnlimitedNatural, LoopNode, Manifestation, MergeNode, Message, MessageEnd, MessageTrigger, Model, MultiplicityElement, NamedElement, Namespace, Node, ObjectFlow, ObjectNode, OpaqueExpression, Operation, OperationTemplateParameter, OutputPin, Package, PackageableElement, PackageImport, PackageMerge, Parameter, ParameterableClassifier, ParameterableElement, ParameterSet, PartDecomposition, Permission, Pin, Port, PrimitiveFunction, PrimitiveType, Profile, ProfileApplication, Property, ProtocolConformance, ProtocolStateMachine, ProtocolTransition, Pseudostate, QualifierValue, RaiseExceptionAction, ReadExtentAction, ReadIsClassifiedObjectAction, ReadLinkAction, ReadLinkObjectEndAction, ReadLinkObjectEndQualifierAction, ReadSelfAction, ReadStructuralFeatureAction, ReadVariableAction, Realization, Reception, ReclassifyObjectAction, RedefinableElement, RedefinableTemplateSignature, Region, Relationship, RemoveStructuralFeatureValueAction, RemoveVariableValueAction, ReplyAction, SendObjectAction, SendSignalAction, Signal, SignalTrigger, Slot, StartOwnedBehaviorAction, State, StateInvariant, StateMachine, Stereotype, Stop, StringExpression, StructuralFeature, StructuralFeatureAction, StructuredActivityNode, StructuredClassifier, Substitution, TemplateableClassifier, TemplateableElement, TemplateBinding, TemplateParameter, TemplateParameterSubstitution, TemplateSignature, TestIdentityAction, TimeConstraint, TimeExpression, TimeInterval, TimeObservationAction, TimeTrigger, Transition, Trigger, Type, TypedElement, Usage, UseCase, ValuePin, ValueSpecification, Variable, VariableAction, Vertex, WriteLinkAction, WriteStructuralFeatureAction, WriteVariableAction

public interface Element
extends EModelElement

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:

See Also:
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 EAnnotationwith 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

copyright

public static final String copyright

See Also:
Constant Field Values
Method Detail

getOwnedElements

public EList getOwnedElements()
Returns the value of the 'Owned Element' reference list. The list contents are of type 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.

Returns:
the value of the 'Owned Element' reference list.
See Also:
UML2Package.getElement_OwnedElement(), getOwner()

getOwner

public Element getOwner()
Returns the value of the 'Owner' reference. It is bidirectional and its opposite is '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.

Returns:
the value of the 'Owner' reference.
See Also:
UML2Package.getElement_Owner(), getOwnedElements()

getOwnedComments

public EList getOwnedComments()
Returns the value of the 'Owned Comment' containment reference list. The list contents are of type 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.

Returns:
the value of the 'Owned Comment' containment reference list.
See Also:
UML2Package.getElement_OwnedComment()

createOwnedComment

public Comment createOwnedComment(EClass eClass)
Creates a Comment and appends it to the 'Owned Comment' containment reference list.

Parameters:
eClass - The Ecore class of the Comment to create.
Returns:
The new Comment.
See Also:
getOwnedComments()

validateNotOwnSelf

public boolean validateNotOwnSelf(DiagnosticChain diagnostics,
                                  Map context)
An invariant constraint based on the following OCL expression: not self.allOwnedElements()->includes(self)


validateHasOwner

public boolean validateHasOwner(DiagnosticChain diagnostics,
                                Map context)
An invariant constraint based on the following OCL expression: self.mustBeOwned() implies owner->notEmpty()


allOwnedElements

public Set allOwnedElements()
A query based on the following OCL expression: ownedElement->union(ownedElement->collect(e | e.allOwnedElements()))


mustBeOwned

public boolean mustBeOwned()
A query based on the following OCL expression: true


createEAnnotation

public EAnnotation createEAnnotation(String source)
Creates an EAnnotationwith the specified source and this element as its Ecore model element.

Parameters:
source - The source of the EAnnotationto create.
Returns:
The new EAnnotation.
See Also:
EModelElement.getEAnnotations()

isApplied

public boolean isApplied(Stereotype stereotype)
Determines whether the specified stereotype is applied to this element.

Parameters:
stereotype - The stereotype to test for application.
Returns:
true if the stereotype is applied to this element; false otherwise.

isRequired

public boolean isRequired(Stereotype stereotype)
Determines whether the specified stereotype is required for this element.

Parameters:
stereotype - The stereotype to test for requirement.
Returns:
true if the stereotype is required for this element; false otherwise.

getApplicableStereotypes

public Set getApplicableStereotypes()
Retrieves the set of stereotypes that are applicable to this element, including those are required and/or may already be applied.

Returns:
The stereotypes applicable to this element.

getApplicableStereotype

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

Parameters:
qualifiedStereotypeName - The qualified name of the applicable stereotype to retrieve.
Returns:
The applicable stereotype with the specified qualified name.

getAppliedStereotypes

public Set getAppliedStereotypes()
Retrieves the set of stereotypes applied to this element.

Returns:
The stereotypes applied to this element.

getAppliedStereotype

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

Parameters:
qualifiedStereotypeName - The qualified name of the applied stereotype to retrieve.
Returns:
The applied stereotype with the specified qualified name.

apply

public void apply(Stereotype stereotype)
Applies the specified stereotype to this element.

Parameters:
stereotype - The stereotype to be applied.
Throws:
IllegalArgumentException - If the stereotype is already applied or is not applicable to this element.

unapply

public void unapply(Stereotype stereotype)
Unapplies the specified stereotype from this element.

Parameters:
stereotype - The stereotype to be unapplied.
Throws:
IllegalArgumentException - If the stereotype is required or is not applied to this element.

getValue

public Object getValue(Stereotype stereotype,
                       String propertyName)
Retrieves the value of the property with the specified name from the specified stereotype application for this element.

Parameters:
stereotype - The stereotype whose application contains the property.
propertyName - The name of the property whose value to retrieve.
Returns:
The value of the applied stereotype property.
Throws:
IllegalArgumentException - If the stereotype is not applied to this element or the property does not exist.

setValue

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

Parameters:
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.
Throws:
IllegalArgumentException - If the stereotype is not applied to this element or the property does not exist.

getModel

public Model getModel()
Retrieves the model that contains (either directly or indirectly) this element.

Returns:
The model containing this element, or null.

getNearestPackage

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

Returns:
The nearest package containing this element, the element itself, or null.

destroy

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

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


getAppliedVersion

public String getAppliedVersion(Stereotype stereotype)
Retrieves the version of the specified stereotype that is applied to this element.

Parameters:
stereotype - The stereotype whose applied version to retrieve.
Returns:
The version of the stereotype, or null if not applied.

getKeywords

public Set getKeywords()
Retrieves the set of keywords for this element.

Returns:
The keywords for this element.

hasKeyword

public boolean hasKeyword(String keyword)
Determines whether this element has the specified keyword.

Parameters:
keyword - The keyword in question.
Returns:
true if this element has the specified keyword; false otherwise.

addKeyword

public void addKeyword(String keyword)
Adds the specified keyword to this element.

Parameters:
keyword - The keyword to be added.
Throws:
IllegalArgumentException - If the keyword is invalid (i.e. empty).

removeKeyword

public void removeKeyword(String keyword)
Removes the specified keyword from this element.

Parameters:
keyword - The keyword to be removed.
Throws:
IllegalArgumentException - If this element does not have the keyword.

Copyright 2003, 2004 IBM Corporation and others.
All Rights Reserved.