org.eclipse.uml2.uml
Interface NamedElement

All Superinterfaces:
Element, org.eclipse.emf.ecore.EModelElement, org.eclipse.emf.ecore.EObject, org.eclipse.emf.common.notify.Notifier
All Known Subinterfaces:
Abstraction, AcceptCallAction, AcceptEventAction, Action, ActionExecutionSpecification, ActionInputPin, Activity, ActivityEdge, ActivityFinalNode, ActivityGroup, ActivityNode, ActivityParameterNode, ActivityPartition, Actor, AddStructuralFeatureValueAction, AddVariableValueAction, AnyReceiveEvent, Artifact, Association, AssociationClass, Behavior, BehavioralFeature, BehavioredClassifier, BehaviorExecutionSpecification, BroadcastSignalAction, CallAction, CallBehaviorAction, CallEvent, CallOperationAction, CentralBufferNode, ChangeEvent, Class, Classifier, ClearAssociationAction, ClearStructuralFeatureAction, ClearVariableAction, Collaboration, CollaborationUse, CombinedFragment, CommunicationPath, Component, ComponentRealization, ConditionalNode, ConnectableElement, ConnectionPointReference, Connector, ConsiderIgnoreFragment, Constraint, Continuation, ControlFlow, ControlNode, CreateLinkAction, CreateLinkObjectAction, CreateObjectAction, DataStoreNode, DataType, DecisionNode, Dependency, DeployedArtifact, Deployment, DeploymentSpecification, DeploymentTarget, DestroyLinkAction, DestroyObjectAction, DestructionOccurrenceSpecification, Device, Duration, DurationConstraint, DurationInterval, DurationObservation, EncapsulatedClassifier, Enumeration, EnumerationLiteral, Event, ExecutableNode, ExecutionEnvironment, ExecutionOccurrenceSpecification, ExecutionSpecification, ExpansionNode, ExpansionRegion, Expression, Extend, Extension, ExtensionEnd, ExtensionPoint, Feature, FinalNode, FinalState, FlowFinalNode, ForkNode, FunctionBehavior, Gate, GeneralizationSet, GeneralOrdering, Include, InformationFlow, InformationItem, InitialNode, InputPin, InstanceSpecification, InstanceValue, Interaction, InteractionConstraint, InteractionFragment, InteractionOperand, InteractionUse, Interface, InterfaceRealization, InterruptibleActivityRegion, Interval, IntervalConstraint, InvocationAction, JoinNode, Lifeline, LinkAction, LiteralBoolean, LiteralInteger, LiteralNull, LiteralReal, LiteralSpecification, LiteralString, LiteralUnlimitedNatural, LoopNode, Manifestation, MergeNode, Message, MessageEnd, MessageEvent, MessageOccurrenceSpecification, Model, Namespace, Node, ObjectFlow, ObjectNode, Observation, OccurrenceSpecification, OpaqueAction, OpaqueBehavior, OpaqueExpression, Operation, OutputPin, Package, PackageableElement, Parameter, ParameterSet, PartDecomposition, Pin, Port, PrimitiveType, Profile, Property, ProtocolStateMachine, ProtocolTransition, Pseudostate, RaiseExceptionAction, ReadExtentAction, ReadIsClassifiedObjectAction, ReadLinkAction, ReadLinkObjectEndAction, ReadLinkObjectEndQualifierAction, ReadSelfAction, ReadStructuralFeatureAction, ReadVariableAction, Realization, Reception, ReclassifyObjectAction, RedefinableElement, RedefinableTemplateSignature, ReduceAction, Region, RemoveStructuralFeatureValueAction, RemoveVariableValueAction, ReplyAction, SendObjectAction, SendSignalAction, SequenceNode, Signal, SignalEvent, StartClassifierBehaviorAction, StartObjectBehaviorAction, State, StateInvariant, StateMachine, Stereotype, StringExpression, StructuralFeature, StructuralFeatureAction, StructuredActivityNode, StructuredClassifier, Substitution, TestIdentityAction, TimeConstraint, TimeEvent, TimeExpression, TimeInterval, TimeObservation, Transition, Trigger, Type, TypedElement, UnmarshallAction, Usage, UseCase, ValuePin, ValueSpecification, ValueSpecificationAction, Variable, VariableAction, Vertex, WriteLinkAction, WriteStructuralFeatureAction, WriteVariableAction

public interface NamedElement
extends Element

A representation of the model object 'Named Element'. A NamedElement is an Element in a model that may have a name. The name may be given directly and/or via the use of a StringExpression.

From package UML::CommonStructure.

The following features are supported:

See Also:
UMLPackage.getNamedElement()

Field Summary
static java.lang.String SEPARATOR
           
 
Method Summary
 org.eclipse.emf.common.util.EList<Namespace> allNamespaces()
          The query allNamespaces() gives the sequence of Namespaces in which the NamedElement is nested, working outwards.
 org.eclipse.emf.common.util.EList<Package> allOwningPackages()
          The query allOwningPackages() returns the set of all the enclosing Namespaces of this NamedElement, working outwards, that are Packages, up to but not including the first such Namespace that is not a Package.
 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(java.lang.String name, Type type)
          Creates a new StringExpression,with the specified 'Name', and 'Type', and sets the 'Name Expression' containment reference
 Usage createUsage(NamedElement supplier)
          Creates a usage between this named element and the specified supplier, owned by this named element's nearest package.
 org.eclipse.emf.common.util.EList<Dependency> getClientDependencies()
          Returns the value of the 'Client Dependency' reference list.
 Dependency getClientDependency(java.lang.String name)
          Retrieves the first Dependency with the specified 'Name' from the 'Client Dependency' reference list
 Dependency getClientDependency(java.lang.String name, boolean ignoreCase, org.eclipse.emf.ecore.EClass eClass)
          Retrieves the first 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)
          The query isDistinguishableFrom() determines whether two NamedElements may logically co-exist within a Namespace.
 boolean isSetName()
          Returns whether the value of the 'Name' attribute is set
 boolean isSetVisibility()
          Returns whether the value of the 'Visibility' attribute is set
 java.lang.String separator()
          The query separator() gives the string that is used to separate names when constructing a qualifiedName.
 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
 void unsetName()
          Unsets the value of the 'Name' attribute
 void unsetVisibility()
          Unsets the value of the 'Visibility' attribute
 boolean validateHasNoQualifiedName(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          If there is no name, or one of the containing Namespaces has no name, there is no qualifiedName.
 boolean validateHasQualifiedName(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          When there is a name, and all of the containing Namespaces have a name, the qualifiedName is constructed from the name of the NamedElement and the names of the containing Namespaces.
 boolean validateVisibilityNeedsOwnership(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          If a NamedElement is owned by something other than a Namespace, it does not have a visibility.
 
Methods inherited from interface org.eclipse.uml2.uml.Element
addKeyword, allOwnedElements, applyStereotype, createEAnnotation, createOwnedComment, destroy, getApplicableStereotype, getApplicableStereotypes, getAppliedStereotype, getAppliedStereotypes, getAppliedSubstereotype, getAppliedSubstereotypes, getKeywords, getModel, getNearestPackage, getOwnedComments, getOwnedElements, getOwner, getRelationships, getRelationships, getRequiredStereotype, getRequiredStereotypes, getSourceDirectedRelationships, getSourceDirectedRelationships, getStereotypeApplication, getStereotypeApplications, getTargetDirectedRelationships, getTargetDirectedRelationships, getValue, hasKeyword, hasValue, isStereotypeApplicable, isStereotypeApplied, isStereotypeRequired, mustBeOwned, removeKeyword, setValue, unapplyStereotype, 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, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Field Detail

SEPARATOR

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

getName

java.lang.String getName()
Returns the value of the 'Name' attribute. The name of the NamedElement.

From package UML::CommonStructure.

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

setName

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

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

unsetName

void unsetName()
Unsets the value of the 'Name' attribute.

See Also:
isSetName(), getName(), setName(String)

isSetName

boolean isSetName()
Returns whether the value of the 'Name' attribute is set.

Returns:
whether the value of the 'Name' attribute is set.
See Also:
unsetName(), getName(), setName(String)

getVisibility

VisibilityKind getVisibility()
Returns the value of the 'Visibility' attribute. The literals are from the enumeration VisibilityKind. Determines whether and how the NamedElement is visible outside its owning Namespace.

From package UML::CommonStructure.

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

setVisibility

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

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

unsetVisibility

void unsetVisibility()
Unsets the value of the 'Visibility' attribute.

See Also:
isSetVisibility(), getVisibility(), setVisibility(VisibilityKind)

isSetVisibility

boolean isSetVisibility()
Returns whether the value of the 'Visibility' attribute is set.

Returns:
whether the value of the 'Visibility' attribute is set.
See Also:
unsetVisibility(), getVisibility(), setVisibility(VisibilityKind)

getQualifiedName

java.lang.String getQualifiedName()
Returns the value of the 'Qualified Name' attribute. A name that 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.

From package UML::CommonStructure.

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

getClientDependencies

org.eclipse.emf.common.util.EList<Dependency> getClientDependencies()
Returns the value of the 'Client Dependency' reference list. The list contents are of type Dependency. Indicates the Dependencies that reference this NamedElement as a client.

From package UML::CommonStructure.

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

getClientDependency

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

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

getClientDependency

Dependency getClientDependency(java.lang.String name,
                               boolean ignoreCase,
                               org.eclipse.emf.ecore.EClass eClass)
Retrieves the first Dependency with the specified 'Name' from the 'Client Dependency' reference list.

Parameters:
name - The 'Name' of the Dependency to retrieve, or null.
ignoreCase - Whether to ignore case in String comparisons.
eClass - The Ecore class of the Dependency to retrieve, or null.
Returns:
The first Dependency with the specified 'Name', or null.
See Also:
getClientDependencies()

getNamespace

Namespace getNamespace()
Returns the value of the 'Namespace' reference. It is bidirectional and its opposite is 'Owned Member'.

This feature subsets the following features:

This feature is a derived union. Specifies the Namespace that owns the NamedElement.

From package UML::CommonStructure.

Returns:
the value of the 'Namespace' reference.
See Also:
UMLPackage.getNamedElement_Namespace(), Namespace.getOwnedMembers()

getNameExpression

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

This feature subsets the following features:

The StringExpression used to define the name of this NamedElement.

From package UML::CommonStructure.

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

setNameExpression

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

StringExpression createNameExpression(java.lang.String name,
                                      Type type)
Creates a new StringExpression,with the specified 'Name', and 'Type', and sets the 'Name Expression' containment reference.

Parameters:
name - The 'Name' for the new StringExpression, or null.
type - The 'Type' for the new StringExpression, or null.
Returns:
The new StringExpression.
See Also:
getNameExpression()

validateHasNoQualifiedName

boolean validateHasNoQualifiedName(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                   java.util.Map<java.lang.Object,java.lang.Object> context)
If there is no name, or one of the containing Namespaces has no name, there is no qualifiedName. name=null or allNamespaces()->select( ns | ns.name=null )->notEmpty() implies qualifiedName = null

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateHasQualifiedName

boolean validateHasQualifiedName(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                 java.util.Map<java.lang.Object,java.lang.Object> context)
When there is a name, and all of the containing Namespaces have a name, the qualifiedName is constructed from the name of the NamedElement and the names of the containing Namespaces. (name <> null and allNamespaces()->select(ns | ns.name = null)->isEmpty()) implies qualifiedName = allNamespaces()->iterate( ns : Namespace; agg: String = name | ns.name.concat(self.separator()).concat(agg))

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

validateVisibilityNeedsOwnership

boolean validateVisibilityNeedsOwnership(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                         java.util.Map<java.lang.Object,java.lang.Object> context)
If a NamedElement is owned by something other than a Namespace, it does not have a visibility. One that is not owned by anything (and hence must be a Package, as this is the only kind of NamedElement that overrides mustBeOwned()) may have a visibility. (namespace = null and owner <> null) implies visibility = null

Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

createDependency

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 new dependency.

getLabel

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


getLabel

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

Parameters:
localize - Whether to localize the label.

createUsage

Usage createUsage(NamedElement supplier)
Creates a usage between this named element and the specified supplier, owned by this named element's nearest package.

Parameters:
supplier - The supplier for the new usage.

allNamespaces

org.eclipse.emf.common.util.EList<Namespace> allNamespaces()
The query allNamespaces() gives the sequence of Namespaces in which the NamedElement is nested, working outwards. result = ( if owner = null then OrderedSet{} else let enclosingNamespace : Namespace = if owner.oclIsKindOf(TemplateParameter) and owner.oclAsType(TemplateParameter).signature.template.oclIsKindOf(Namespace) then owner.oclAsType(TemplateParameter).signature.template.oclAsType(Namespace) else namespace endif in enclosingNamespace.allNamespaces()->prepend(enclosingNamespace) endif)

From package UML::CommonStructure.


isDistinguishableFrom

boolean isDistinguishableFrom(NamedElement n,
                              Namespace ns)
The query isDistinguishableFrom() determines whether two NamedElements may logically co-exist within a Namespace. By default, two named elements are distinguishable if (a) they have types neither of which is a kind of the other or (b) they have different names. result = ((self.oclIsKindOf(n.oclType()) or n.oclIsKindOf(self.oclType())) implies ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->isEmpty() )

From package UML::CommonStructure.


separator

java.lang.String separator()
The query separator() gives the string that is used to separate names when constructing a qualifiedName. result = ('::')

From package UML::CommonStructure.


allOwningPackages

org.eclipse.emf.common.util.EList<Package> allOwningPackages()
The query allOwningPackages() returns the set of all the enclosing Namespaces of this NamedElement, working outwards, that are Packages, up to but not including the first such Namespace that is not a Package. result = (if namespace.oclIsKindOf(Package) then let owningPackage : Package = namespace.oclAsType(Package) in owningPackage->union(owningPackage.allOwningPackages()) else null endif)

From package UML::CommonStructure.


Copyright 2003, 2014 IBM Corporation, CEA, and others.
All Rights Reserved.