edu.cmu.sei.aadl.aadl2.impl
Class NamedElementImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.EObjectImpl
              extended by edu.cmu.sei.aadl.aadl2.parsesupport.AObjectImpl
                  extended by edu.cmu.sei.aadl.aadl2.impl.ElementImpl
                      extended by edu.cmu.sei.aadl.aadl2.impl.NamedElementImpl
All Implemented Interfaces:
Element, NamedElement, AObject, org.eclipse.core.runtime.IAdaptable, org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject
Direct Known Subclasses:
AadlPackageImpl, AbstractImpl, AnnexLibraryImpl, BusImpl, ClassifierFeatureImpl, ComponentTypeRenameImpl, ConnectionEndImpl, ContextImpl, DataImpl, DeviceImpl, EndToEndFlowElementImpl, EnumerationLiteralImpl, FeatureGroupTypeRenameImpl, InstanceObjectImpl, MemoryImpl, ModalElementImpl, NamespaceImpl, PackageRenameImpl, ProcessImpl, ProcessorImpl, RefinableElementImpl, SubprogramGroupImpl, SubprogramImpl, SystemImpl, ThreadGroupImpl, ThreadImpl, TypedElementImpl, TypeImpl, VirtualBusImpl, VirtualProcessorImpl

public abstract class NamedElementImpl
extends ElementImpl
implements NamedElement

An implementation of the model object 'Named Element'.

The following features are implemented:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolder, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderBaseImpl, org.eclipse.emf.ecore.impl.BasicEObjectImpl.EPropertiesHolderImpl
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
protected  java.lang.String name
          The cached value of the 'Name' attribute
protected static java.lang.String NAME_EDEFAULT
          The default value of the 'Name' attribute
protected  org.eclipse.emf.common.util.EList<PropertyAssociation> ownedPropertyAssociations
          The cached value of the 'Owned Property Association' containment reference list
protected static java.lang.String QUALIFIED_NAME_EDEFAULT
          The default value of the 'Qualified Name' attribute
 
Fields inherited from class edu.cmu.sei.aadl.aadl2.impl.ElementImpl
OWNED_ELEMENT_ESUBSETS, ownedComments
 
Fields inherited from class edu.cmu.sei.aadl.aadl2.parsesupport.AObjectImpl
copyright, locationReference
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eContainer, eContainerFeatureID, EDELIVER, EDYNAMIC_CLASS, eFlags, ELAST_EOBJECT_FLAG, ELAST_NOTIFIER_FLAG, eProperties, EPROXY
 
Fields inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
EVIRTUAL_GET, EVIRTUAL_IS_SET, EVIRTUAL_NO_VALUE, EVIRTUAL_SET, EVIRTUAL_UNSET
 
Fields inherited from interface edu.cmu.sei.aadl.aadl2.parsesupport.AObject
copyright
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Constructor Summary
protected NamedElementImpl()
           
 
Method Summary
 boolean acceptsProperty(Property property)
          Query whether this object accepts values for the given property.
 org.eclipse.emf.common.util.EList<Namespace> allNamespaces()
           
 void checkPropertyAssociation(Property pd, java.util.Collection<? extends PropertyExpression> vals)
          Check that the proposed association is legal.
 PropertyAssociation createOwnedPropertyAssociation()
           
 org.eclipse.emf.common.notify.NotificationChain eBasicRemoveFromContainerFeature(org.eclipse.emf.common.notify.NotificationChain msgs)
           
 java.lang.Object eGet(int featureID, boolean resolve, boolean coreType)
           
 org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 boolean eIsSet(int featureID)
           
 void eSet(int featureID, java.lang.Object newValue)
           
protected  org.eclipse.emf.ecore.EClass eStaticClass()
           
 void eUnset(int featureID)
           
 java.lang.String getName()
           
 Namespace getNamespace()
           
 org.eclipse.emf.common.util.EList<PropertyAssociation> getOwnedPropertyAssociations()
           
 PropertyAcc getPropertyValue(Property property)
          Returns the property value for the property specified by property
 void getPropertyValueInternal(Property pn, PropertyAcc pas, boolean fromInstanceSlaveCall)
          Helper routine for computing the value of the property.
 java.util.List<PropertyExpression> getPropertyValueList(Property property)
          Retrieves a non-modal property value as a list.
 java.lang.String getQualifiedName()
           
 PropertyExpression getSimplePropertyValue(Property property)
          Retrieves the property value of a non-modal, single-valued property.
 boolean has_no_qualified_name(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
           
 boolean has_qualified_name(org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
           
 boolean hasName()
          Returns true if this NamedElement has a name.
 boolean isDistinguishableFrom(NamedElement n, Namespace ns)
           
 java.lang.String qualifiedName()
           
 void removePropertyAssociations(Property pd)
          Remove all the local property associations for the given property definition.
 void removePropertyAssociations(Property pd, java.util.List<? extends Mode> modes)
          Modify the modal property associations so that there are no local associations for the given property for the given modes.
 java.lang.String separator()
           
 void setName(java.lang.String newName)
           
 PropertyAssociation setPropertyValue(Property pd, java.util.List<? extends PropertyExpression> pes)
          Set property association for given property definition with specified value list.
 PropertyAssociation setPropertyValue(Property pd, java.util.List<? extends PropertyExpression> pvl, java.util.List<? extends Mode> modes)
          Set property association for given property definition to the specified value list in the given modes.
 PropertyAssociation setPropertyValue(Property pd, PropertyValue pv)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.cmu.sei.aadl.aadl2.impl.ElementImpl
allOwnedElements, create, createOwnedComment, getCacheAdapter, getChildren, getContainingClassifier, getContainingComponentImpl, getElementRoot, getOwnedComments, getOwnedElements, getOwner, has_owner, isSetOwnedElements, isSetOwner, mustBeOwned, not_own_self
 
Methods inherited from class edu.cmu.sei.aadl.aadl2.parsesupport.AObjectImpl
getAdapter, getLocationReference, setLocationReference, setLocationReference
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStore, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.cmu.sei.aadl.aadl2.Element
allOwnedElements, createOwnedComment, getChildren, getContainingClassifier, getContainingComponentImpl, getElementRoot, getOwnedComments, getOwnedElements, getOwner, has_owner, mustBeOwned, not_own_self
 
Methods inherited from interface edu.cmu.sei.aadl.aadl2.parsesupport.AObject
getLocationReference, setLocationReference, setLocationReference
 
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
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Field Detail

NAME_EDEFAULT

protected static final java.lang.String NAME_EDEFAULT
The default value of the 'Name' attribute.

See Also:
getName()

name

protected java.lang.String name
The cached value of the 'Name' attribute.

See Also:
getName()

QUALIFIED_NAME_EDEFAULT

protected static final java.lang.String QUALIFIED_NAME_EDEFAULT
The default value of the 'Qualified Name' attribute.

See Also:
getQualifiedName()

ownedPropertyAssociations

protected org.eclipse.emf.common.util.EList<PropertyAssociation> ownedPropertyAssociations
The cached value of the 'Owned Property Association' containment reference list.

See Also:
getOwnedPropertyAssociations()
Constructor Detail

NamedElementImpl

protected NamedElementImpl()

Method Detail

eStaticClass

protected org.eclipse.emf.ecore.EClass eStaticClass()

Overrides:
eStaticClass in class ElementImpl

getName

public java.lang.String getName()

Specified by:
getName in interface NamedElement
Returns:
the value of the 'Name' attribute.
See Also:
NamedElement.setName(String), Aadl2Package.getNamedElement_Name()

setName

public void setName(java.lang.String newName)

Specified by:
setName in interface NamedElement
Parameters:
newName - the new value of the 'Name' attribute.
See Also:
NamedElement.getName()

getQualifiedName

public java.lang.String getQualifiedName()

Specified by:
getQualifiedName in interface NamedElement
Returns:
the value of the 'Qualified Name' attribute.
See Also:
Aadl2Package.getNamedElement_QualifiedName()

getNamespace

public Namespace getNamespace()

Specified by:
getNamespace in interface NamedElement
Returns:
the value of the 'Namespace' container reference.
See Also:
Aadl2Package.getNamedElement_Namespace(), Namespace.getOwnedMembers()

getOwnedPropertyAssociations

public org.eclipse.emf.common.util.EList<PropertyAssociation> getOwnedPropertyAssociations()

Specified by:
getOwnedPropertyAssociations in interface NamedElement
Returns:
the value of the 'Owned Property Association' containment reference list.
See Also:
Aadl2Package.getNamedElement_OwnedPropertyAssociation()

createOwnedPropertyAssociation

public PropertyAssociation createOwnedPropertyAssociation()

Specified by:
createOwnedPropertyAssociation in interface NamedElement
Returns:
The new PropertyAssociation.
See Also:
NamedElement.getOwnedPropertyAssociations()

has_no_qualified_name

public boolean has_no_qualified_name(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                     java.util.Map<java.lang.Object,java.lang.Object> context)

Specified by:
has_no_qualified_name in interface NamedElement
Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

has_qualified_name

public boolean has_qualified_name(org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                  java.util.Map<java.lang.Object,java.lang.Object> context)

Specified by:
has_qualified_name in interface NamedElement
Parameters:
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

allNamespaces

public org.eclipse.emf.common.util.EList<Namespace> allNamespaces()

Specified by:
allNamespaces in interface NamedElement

isDistinguishableFrom

public boolean isDistinguishableFrom(NamedElement n,
                                     Namespace ns)

Specified by:
isDistinguishableFrom in interface NamedElement

separator

public java.lang.String separator()

Specified by:
separator in interface NamedElement

qualifiedName

public java.lang.String qualifiedName()

Specified by:
qualifiedName in interface NamedElement

eInverseRemove

public org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd,
                                                                      int featureID,
                                                                      org.eclipse.emf.common.notify.NotificationChain msgs)

Overrides:
eInverseRemove in class ElementImpl

eBasicRemoveFromContainerFeature

public org.eclipse.emf.common.notify.NotificationChain eBasicRemoveFromContainerFeature(org.eclipse.emf.common.notify.NotificationChain msgs)

Overrides:
eBasicRemoveFromContainerFeature in class ElementImpl

eGet

public java.lang.Object eGet(int featureID,
                             boolean resolve,
                             boolean coreType)

Specified by:
eGet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eGet in class ElementImpl

eSet

public void eSet(int featureID,
                 java.lang.Object newValue)

Specified by:
eSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eSet in class ElementImpl

eUnset

public void eUnset(int featureID)

Specified by:
eUnset in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eUnset in class ElementImpl

eIsSet

public boolean eIsSet(int featureID)

Specified by:
eIsSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eIsSet in class ElementImpl

toString

public java.lang.String toString()

Overrides:
toString in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

hasName

public boolean hasName()
Description copied from interface: NamedElement
Returns true if this NamedElement has a name. This method will check for null and the empty string.

Specified by:
hasName in interface NamedElement
Returns:
true if object has a name; false otherwise.

getSimplePropertyValue

public PropertyExpression getSimplePropertyValue(Property property)
                                          throws InvalidModelException,
                                                 PropertyNotPresentException,
                                                 PropertyIsModalException,
                                                 java.lang.IllegalStateException,
                                                 java.lang.IllegalArgumentException,
                                                 PropertyDoesNotApplyToHolderException,
                                                 PropertyIsListException
Retrieves the property value of a non-modal, single-valued property. Use this method if you know the property can only have a single value and is not modal

Specified by:
getSimplePropertyValue in interface NamedElement
Parameters:
property - Property
Returns:
PropertyValue, does not return null.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException
PropertyIsModalException
java.lang.IllegalStateException
java.lang.IllegalArgumentException
PropertyDoesNotApplyToHolderException
PropertyIsListException
See Also:
SystemInstance.setCurrentSystemOperationMode(edu.cmu.sei.aadl.aadl2.instance.SystemOperationMode)

getPropertyValue

public PropertyAcc getPropertyValue(Property property)
                             throws java.lang.IllegalStateException,
                                    InvalidModelException,
                                    PropertyDoesNotApplyToHolderException,
                                    java.lang.IllegalArgumentException
Returns the property value for the property specified by property

Specified by:
getPropertyValue in interface NamedElement
Parameters:
property - The property to lookup
Returns:
AadlModalPropertyValue
Throws:
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyDoesNotApplyToHolderException - Thrown if the given property does not apply to the property holder, i.e., NamedElement.acceptsProperty(Property) returns false .
java.lang.IllegalArgumentException - Thrown if property is null.

acceptsProperty

public boolean acceptsProperty(Property property)
Description copied from interface: NamedElement
Query whether this object accepts values for the given property. That is, does the given property apply to this element?

Specified by:
acceptsProperty in interface NamedElement
Parameters:
property - The property definition to test.
Returns:
true if the given property applies to this element.

getPropertyValueInternal

public void getPropertyValueInternal(Property pn,
                                     PropertyAcc pas,
                                     boolean fromInstanceSlaveCall)
                              throws InvalidModelException
Description copied from interface: NamedElement
Helper routine for computing the value of the property. As the name suggests, this method is not intended for use by clients of the model, but is used during the property lookup process. It should really be a protected method in NamedElementImpl, but because of the way that EMF deals with multiple inheritance, not all implementations of NamedElement actually extend from NamedElementImpl.

In particular, this method does not create a new property value accumulator—it uses the one provided—and it does not look up the default value of the property.

Specified by:
getPropertyValueInternal in interface NamedElement
Parameters:
pn - The property whose value is to be retrieved. It must be the case that this property is accepted by the property holder, i.e., NamedElement.acceptsProperty(Property) must return true.
fromInstanceSlaveCall - true if the call is performing a lookup on the declarative model on behalf of an instance model object. When true the lookup algorithm ignores the "inherits" attribute on property definitions when it would mean that the lookup should defer to the containing component implementation. Also disables the interpretation of contained property associations in the declarative model because they have already been applied to the instance model at this point. The expectation is that the instance model lookup itself is not ignoring the inherits attribute, and thus any inherited property values will still be found correctly. Interpreting the inherits attribute during the declarative model search is redundant and causes problems later on. This flag does not affect lookup for feature declarations because in that case the inherit flag defers to the component type or feature group type.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.

setPropertyValue

public final PropertyAssociation setPropertyValue(Property pd,
                                                  java.util.List<? extends PropertyExpression> pes)
Description copied from interface: NamedElement
Set property association for given property definition with specified value list. The property association is assumed to apply to all modes; all previous property associations for this property are removed from the property holder. The PropertyAssociation#isDerived() status of the association is set to false.

When the property is not list-valued, i.e., pd.isList() is false, the provided list of values must be of length 1, i.e., pvl.size() == 1.

When invoked on an instance model object (i.e., a subtype of InstanceObject), the property association is made to apply only to current system operation mode as determined from the containing system instance's SystemInstance.getCurrentSystemOperationMode() method.

Specified by:
setPropertyValue in interface NamedElement
Parameters:
pd - property definition object
pes - List of property value objects.
Returns:
PropertyAssociation that has been set

checkPropertyAssociation

public void checkPropertyAssociation(Property pd,
                                     java.util.Collection<? extends PropertyExpression> vals)
Check that the proposed association is legal.

Specified by:
checkPropertyAssociation in interface NamedElement

removePropertyAssociations

public final void removePropertyAssociations(Property pd)
Description copied from interface: NamedElement
Remove all the local property associations for the given property definition. Only the property associations directly contained in the NamedElement are affected, that is, any contained property associations declared in this component, but applicable to another component are not searched.

Specified by:
removePropertyAssociations in interface NamedElement
Parameters:
pd - The property definition

removePropertyAssociations

public final void removePropertyAssociations(Property pd,
                                             java.util.List<? extends Mode> modes)
Description copied from interface: NamedElement
Modify the modal property associations so that there are no local associations for the given property for the given modes. Does not affect the property's non-modal association. This method may both remove associations (if all the association's modes are in the given list) and modify associations (if some of the association's modes are in the given list). Only the property associations directly contained in the NamedElement are affected, that is, any contained property associations declared in this component, but applicable to another component are not searched.

Specified by:
removePropertyAssociations in interface NamedElement
Parameters:
pd - The property definition
modes - list of modes

setPropertyValue

public final PropertyAssociation setPropertyValue(Property pd,
                                                  java.util.List<? extends PropertyExpression> pvl,
                                                  java.util.List<? extends Mode> modes)
Description copied from interface: NamedElement
Set property association for given property definition to the specified value list in the given modes. The existing value list is replaced for the given modes. The PropertyAssociation#isDerived() status of the association is set to false.

When the property is not list-valued, i.e., pd.isList() is false, the provided list of values must be of length 1, i.e., pvl.size() == 1.

Unlike NamedElement.setPropertyValue(Property, List), this method is not affected by the current system operation mode.

Specified by:
setPropertyValue in interface NamedElement
Parameters:
pd - property definition object
pvl - List of property value objects
modes - list of modes.
Returns:
PropertyAssociation that has been set

getPropertyValueList

public final java.util.List<PropertyExpression> getPropertyValueList(Property property)
                                                              throws InvalidModelException,
                                                                     java.lang.IllegalArgumentException,
                                                                     PropertyNotPresentException,
                                                                     PropertyIsModalException,
                                                                     java.lang.IllegalStateException,
                                                                     PropertyDoesNotApplyToHolderException
Retrieves a non-modal property value as a list. Use this method if you know that the property is defined as a LIST OF. While this method can be used on scalar properties, getSimplePropertyValue should be used if you know that it is scalar. If the property is scalar, a list of length 1 is returned.

Specified by:
getPropertyValueList in interface NamedElement
Parameters:
property - PropertyDefinition
Returns:
A list of PropertyValues. This does not return null.
Throws:
InvalidModelException
java.lang.IllegalArgumentException
PropertyNotPresentException
PropertyIsModalException
java.lang.IllegalStateException
PropertyDoesNotApplyToHolderException

setPropertyValue

public final PropertyAssociation setPropertyValue(Property pd,
                                                  PropertyValue pv)
Specified by:
setPropertyValue in interface NamedElement