org.eclipse.uml2
Interface NamedElement

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

public interface NamedElement
extends TemplateableElement

A representation of the model object 'Named Element'. A named element represents elements that may have a name. The name is used for identification of the named element within the namespace in which it is defined. A named element also has a qualified name that allows it to be unambiguously identified within a hierarchy of nested namespaces. NamedElement is an abstract metaclass.

The following features are supported:

See Also:
UML2Package.getNamedElement()

Field Summary
static java.lang.String copyright
           
static java.lang.String SEPARATOR
           
 
Method Summary
 java.util.List allNamespaces()
           A query based on the following OCL expression: if self.namespace->isEmpty() then Sequence{} else self.namespace.allNamespaces()->prepend(self.namespace) endif
 Dependency createDependency(NamedElement supplier)
          Creates a dependency between this named element and the specified supplier, owned by this named element's nearest package.
 StringExpression createNameExpression()
          Creates a StringExpression and sets the 'Name Expression' containment reference
 StringExpression createNameExpression(EClass eClass)
          Deprecated. Use #createNameExpression() instead.
 EList getClientDependencies()
          Returns the value of the 'Client Dependency' reference list.
 Dependency getClientDependency(java.lang.String name)
          Retrieves the Dependency with the specified 'Name' from the 'Client Dependency' reference list
 java.lang.String getLabel()
          Retrieves a localized label for this named element.
 java.lang.String getLabel(boolean localize)
          Retrieves a label for this named element, localized if indicated.
 java.lang.String getName()
          Returns the value of the 'Name' attribute.
 StringExpression getNameExpression()
          Returns the value of the 'Name Expression' containment reference
 Namespace getNamespace()
          Returns the value of the 'Namespace' reference.
 java.lang.String getQualifiedName()
          Returns the value of the 'Qualified Name' attribute.
 VisibilityKind getVisibility()
          Returns the value of the 'Visibility' attribute.
 boolean isDistinguishableFrom(NamedElement n, Namespace ns)
           A query based on the following OCL expression: if self.oclIsKindOf(n.oclType) or n.oclIsKindOf(self.oclType) then ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->isEmpty() else true endif
 java.lang.String qualifiedName()
           A query based on the following OCL expression: if self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty() then self.allNamespaces()->iterate( ns : Namespace; result: String = self.name | ns.name->union(self.separator())->union(result)) else Set{} endif
 java.lang.String separator()
           A query based on the following OCL expression: '::'
 void setName(java.lang.String value)
          Sets the value of the 'Name' attribute
 void setNameExpression(StringExpression value)
          Sets the value of the 'Name Expression' containment reference
 void setVisibility(VisibilityKind value)
          Sets the value of the 'Visibility' attribute
 boolean validateNoName(DiagnosticChain diagnostics, java.util.Map context)
           An invariant constraint based on the following OCL expression: self.name->isEmpty() or self.allNamespaces()->select(ns | ns.name->isEmpty())->notEmpty() implies self.qualifiedName->isEmpty()
 boolean validateQualifiedName(DiagnosticChain diagnostics, java.util.Map context)
           An invariant constraint based on the following OCL expression: (self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty()) implies self.qualifiedName = self.allNamespaces()->iterate( ns : Namespace; result: String = self.name | ns.name->union(self.separator())->union(result))
 boolean validateVisibilityNeedsOwnership(DiagnosticChain diagnostics, java.util.Map context)
           An invariant constraint based on the following OCL expression: namespace->isEmpty() implies visibility->isEmpty()
 
Methods inherited from interface org.eclipse.uml2.TemplateableElement
createOwnedTemplateSignature, createOwnedTemplateSignature, createTemplateBinding, createTemplateBinding, getOwnedTemplateSignature, getTemplateBindings, parameterableElements, setOwnedTemplateSignature
 
Methods inherited from interface org.eclipse.uml2.Element
addKeyword, allOwnedElements, apply, createEAnnotation, createOwnedComment, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedVersion, getKeywords, getModel, getNearestPackage, getOwnedComments, getOwnedElements, getOwner, getValue, hasKeyword, hasValue, isApplied, isRequired, mustBeOwned, removeKeyword, setValue, unapply, validateHasOwner, validateNotOwnSelf
 
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 java.lang.String copyright

See Also:
Constant Field Values

SEPARATOR

public static final java.lang.String SEPARATOR
See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Returns the value of the 'Name' attribute. The default value is "".

If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here...

The name of the NamedElement.

Returns:
the value of the 'Name' attribute.
See Also:
setName(String), UML2Package.getNamedElement_Name()

setName

public void setName(java.lang.String value)
Sets the value of the 'Name' attribute.

Parameters:
value - the new value of the 'Name' attribute.
See Also:
getName()

getQualifiedName

public java.lang.String getQualifiedName()
Returns the value of the 'Qualified Name' attribute. The default value is "".

If the meaning of the 'Qualified Name' attribute isn't clear, there really should be more of a description here...

A name which allows the NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from the names of the containing namespaces starting at the root of the hierarchy and ending with the name of the NamedElement itself. This is a derived attribute.

Returns:
the value of the 'Qualified Name' attribute.
See Also:
UML2Package.getNamedElement_QualifiedName()

getVisibility

public VisibilityKind getVisibility()
Returns the value of the 'Visibility' attribute. The literals are from the enumeration VisibilityKind.

If the meaning of the 'Visibility' attribute isn't clear, there really should be more of a description here...

Determines the visibility of the NamedElement within different Namespaces within the overall model. Package Dependencies (�Dependencies� on page 94)

Returns:
the value of the 'Visibility' attribute.
See Also:
VisibilityKind, setVisibility(VisibilityKind), UML2Package.getNamedElement_Visibility()

setVisibility

public void setVisibility(VisibilityKind value)
Sets the value of the 'Visibility' attribute.

Parameters:
value - the new value of the 'Visibility' attribute.
See Also:
VisibilityKind, getVisibility()

getClientDependencies

public EList getClientDependencies()
Returns the value of the 'Client Dependency' reference list. The list contents are of type Dependency. It is bidirectional and its opposite is 'Client'.

If the meaning of the 'Client Dependency' reference list isn't clear, there really should be more of a description here...

Returns:
the value of the 'Client Dependency' reference list.
See Also:
UML2Package.getNamedElement_ClientDependency(), Dependency.getClients()

getClientDependency

public Dependency getClientDependency(java.lang.String name)
Retrieves the Dependency with the specified 'Name' from the 'Client Dependency' reference list.

Parameters:
name - The 'Name' of the Dependency to retrieve.
Returns:
The Dependency with the specified 'Name', or null.
See Also:
getClientDependencies()

getNameExpression

public StringExpression getNameExpression()
Returns the value of the 'Name Expression' containment reference.

If the meaning of the 'Name Expression' containment reference isn't clear, there really should be more of a description here...

The expression used to define the name of this named element.

Returns:
the value of the 'Name Expression' containment reference.
See Also:
setNameExpression(StringExpression), UML2Package.getNamedElement_NameExpression()

setNameExpression

public void setNameExpression(StringExpression value)
Sets the value of the 'Name Expression' containment reference.

Parameters:
value - the new value of the 'Name Expression' containment reference.
See Also:
getNameExpression()

createNameExpression

public StringExpression createNameExpression(EClass eClass)
Deprecated. Use #createNameExpression() instead.

Creates a StringExpression and sets the 'Name Expression' containment reference.

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

createNameExpression

public StringExpression createNameExpression()
Creates a StringExpression and sets the 'Name Expression' containment reference.

Returns:
The new StringExpression.
See Also:
getNameExpression()

allNamespaces

public java.util.List allNamespaces()
A query based on the following OCL expression: if self.namespace->isEmpty() then Sequence{} else self.namespace.allNamespaces()->prepend(self.namespace) endif


isDistinguishableFrom

public boolean isDistinguishableFrom(NamedElement n,
                                     Namespace ns)
A query based on the following OCL expression: if self.oclIsKindOf(n.oclType) or n.oclIsKindOf(self.oclType) then ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->isEmpty() else true endif


separator

public java.lang.String separator()
A query based on the following OCL expression: '::'


qualifiedName

public java.lang.String qualifiedName()
A query based on the following OCL expression: if self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty() then self.allNamespaces()->iterate( ns : Namespace; result: String = self.name | ns.name->union(self.separator())->union(result)) else Set{} endif


validateVisibilityNeedsOwnership

public boolean validateVisibilityNeedsOwnership(DiagnosticChain diagnostics,
                                                java.util.Map context)
An invariant constraint based on the following OCL expression: namespace->isEmpty() implies visibility->isEmpty()


getNamespace

public Namespace getNamespace()
Returns the value of the 'Namespace' reference. It is bidirectional and its opposite is 'Owned Member'. Specifies the namespace that owns the NamedElement. Subsets Element::owner. This is a derived union.

Returns:
the value of the 'Namespace' reference.
See Also:
org.eclipse.uml2.UML2Package#getNamedElement_Namespace(), Namespace.getOwnedMembers()

validateNoName

public boolean validateNoName(DiagnosticChain diagnostics,
                              java.util.Map context)
An invariant constraint based on the following OCL expression: self.name->isEmpty() or self.allNamespaces()->select(ns | ns.name->isEmpty())->notEmpty() implies self.qualifiedName->isEmpty()


validateQualifiedName

public boolean validateQualifiedName(DiagnosticChain diagnostics,
                                     java.util.Map context)
An invariant constraint based on the following OCL expression: (self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty()) implies self.qualifiedName = self.allNamespaces()->iterate( ns : Namespace; result: String = self.name | ns.name->union(self.separator())->union(result))


getLabel

public java.lang.String getLabel()
Retrieves a localized label for this named element.

Returns:
A localized label for this named element.

getLabel

public java.lang.String getLabel(boolean localize)
Retrieves a label for this named element, localized if indicated.

Parameters:
localize - Whether the label should be localized.
Returns:
A (localized) label for this named element.

createDependency

public Dependency createDependency(NamedElement supplier)
Creates a dependency between this named element and the specified supplier, owned by this named element's nearest package.

Parameters:
supplier - The supplier for the dependency.
Returns:
The new dependency.
Throws:
java.lang.IllegalArgumentException - If this named element is not directly or indirectly owned by a package.

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