org.eclipse.stp.core.sca.impl
Class ImplementationComponentImpl

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 org.eclipse.stp.core.sca.impl.SCAObjectImpl
                  extended by org.eclipse.stp.core.internal.sca.SCAInternalObjectImpl
                      extended by org.eclipse.stp.core.sca.impl.ComponentImpl
                          extended by org.eclipse.stp.core.sca.impl.ImplementationComponentImpl
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject, SCAInternalObject, Component, ImplementationComponent, SCAObject

public class ImplementationComponentImpl
extends ComponentImpl
implements ImplementationComponent

An implementation of the model object 'Implementation Component'.

The following features are implemented:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
static java.lang.String copyright
           
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
ELAST_EOBJECT_FLAG
 
Fields inherited from interface org.eclipse.stp.core.sca.Component
STATE_ABSTRACT, STATE_IMPLEMENTED, STATE_TYPED, TYPE_ABSTRACT
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Method Summary
 org.eclipse.emf.common.notify.NotificationChain basicSetImplementation(Implementation newImplementation, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 java.lang.Object eGet(org.eclipse.emf.ecore.EStructuralFeature eFeature, boolean resolve)
           
 org.eclipse.emf.common.notify.NotificationChain eInverseAdd(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, java.lang.Class baseClass, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, java.lang.Class baseClass, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 boolean eIsSet(org.eclipse.emf.ecore.EStructuralFeature eFeature)
           
 void eSet(org.eclipse.emf.ecore.EStructuralFeature eFeature, java.lang.Object newValue)
           
 void eUnset(org.eclipse.emf.ecore.EStructuralFeature eFeature)
           
 org.eclipse.emf.ecore.util.FeatureMap getAny()
           
 org.eclipse.emf.ecore.util.FeatureMap getAnyAttribute()
           
 Implementation getImplementation()
           
 org.eclipse.emf.ecore.util.FeatureMap getImplementationGroup()
           
 int getState()
           
 java.lang.String getType()
           
 ComponentType resolveComponentType()
          Uses the Implementation to resolve the ComponentType.
 Implementation setAbstractImplementation(ComponentType newComponentType)
          A convenience method to set an abstract implementation type (SCAPackage.eINSTANCE.getSCACoreRoot_ImplementationAbstract()).
 void setImplementation(Implementation newImplementation)
           
 void setImplementationGen(Implementation newImplementation)
           
 Implementation setSpecializedImplementation(Implementation newImplementation)
          To correctly support substitution groups, the specific EMF feature for an implementation element type must be specified through a FeatureAdapter attached to the Implementation.
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.stp.core.sca.impl.ComponentImpl
basicSetPropertyValuesSet, basicSetReferenceValuesSet, getComposite, getName, getPropertyValuesSet, getReferenceValues, getReferenceValues, getReferenceValues, getReferenceValuesSet, getSingleWireSource, getSingleWireTarget, getWireSource, getWireSource, getWireSourcesWiredToTarget, getWireTarget, getWireTarget, hasValidAbstractType, setName, setPropertyValuesSet, setReferenceValue, setReferenceValuesSet
 
Methods inherited from class org.eclipse.stp.core.internal.sca.SCAInternalObjectImpl
getEObject, getFlags
 
Methods inherited from class org.eclipse.stp.core.sca.impl.SCAObjectImpl
addStatus, clearStatus, getStatus
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eIsProxy, eSetClass, eSetDeliver, eSetProxyURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eContainer, eContainingFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eInternalResource, eInverseAdd, eInverseRemove, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eResolveProxy, eResource, eSet, eSetResource, eSetStore, eSetting, eStore, eUnset, eURIFragmentSegment, eVirtualGet, eVirtualGet, eVirtualIsSet, eVirtualSet, eVirtualUnset
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.stp.core.sca.Component
getComposite, getName, getPropertyValuesSet, getReferenceValues, getReferenceValues, getReferenceValues, getSingleWireSource, getSingleWireTarget, getWireSource, getWireSource, getWireSourcesWiredToTarget, getWireTarget, getWireTarget, setName, setPropertyValuesSet, setReferenceValue
 
Methods inherited from interface org.eclipse.stp.core.sca.SCAObject
addStatus, clearStatus, getEObject, getFlags, getStatus
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eResource
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eNotify
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Field Detail

copyright

public static final java.lang.String copyright

See Also:
Constant Field Values
Method Detail

getImplementationGroup

public org.eclipse.emf.ecore.util.FeatureMap getImplementationGroup()


getImplementation

public Implementation getImplementation()

Specified by:
getImplementation in interface Component
Returns:
The current implementation set on this Component.

basicSetImplementation

public org.eclipse.emf.common.notify.NotificationChain basicSetImplementation(Implementation newImplementation,
                                                                              org.eclipse.emf.common.notify.NotificationChain msgs)


setImplementationGen

public void setImplementationGen(Implementation newImplementation)


getAny

public org.eclipse.emf.ecore.util.FeatureMap getAny()

Specified by:
getAny in interface ImplementationComponent
Returns:
the value of the 'Any' attribute list.
See Also:
SCAPackage.getImplementationComponent_Any()

getAnyAttribute

public org.eclipse.emf.ecore.util.FeatureMap getAnyAttribute()

Specified by:
getAnyAttribute in interface ImplementationComponent
Returns:
the value of the 'Any Attribute' attribute list.
See Also:
SCAPackage.getImplementationComponent_AnyAttribute()

eInverseAdd

public org.eclipse.emf.common.notify.NotificationChain eInverseAdd(org.eclipse.emf.ecore.InternalEObject otherEnd,
                                                                   int featureID,
                                                                   java.lang.Class baseClass,
                                                                   org.eclipse.emf.common.notify.NotificationChain msgs)

Specified by:
eInverseAdd in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eInverseAdd in class ComponentImpl

eInverseRemove

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

Specified by:
eInverseRemove in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eInverseRemove in class ComponentImpl

eGet

public java.lang.Object eGet(org.eclipse.emf.ecore.EStructuralFeature eFeature,
                             boolean resolve)

Specified by:
eGet in interface org.eclipse.emf.ecore.EObject
Overrides:
eGet in class ComponentImpl

eSet

public void eSet(org.eclipse.emf.ecore.EStructuralFeature eFeature,
                 java.lang.Object newValue)

Specified by:
eSet in interface org.eclipse.emf.ecore.EObject
Overrides:
eSet in class ComponentImpl

eUnset

public void eUnset(org.eclipse.emf.ecore.EStructuralFeature eFeature)

Specified by:
eUnset in interface org.eclipse.emf.ecore.EObject
Overrides:
eUnset in class ComponentImpl

eIsSet

public boolean eIsSet(org.eclipse.emf.ecore.EStructuralFeature eFeature)

Specified by:
eIsSet in interface org.eclipse.emf.ecore.EObject
Overrides:
eIsSet in class ComponentImpl

toString

public java.lang.String toString()

Overrides:
toString in class ComponentImpl

setImplementation

public void setImplementation(Implementation newImplementation)


setSpecializedImplementation

public Implementation setSpecializedImplementation(Implementation newImplementation)
Description copied from interface: Component
To correctly support substitution groups, the specific EMF feature for an implementation element type must be specified through a FeatureAdapter attached to the Implementation. Component Handlers or other clients should set the feature using FeatureAdapter.setFeature(SCAObject, EStructuralFeature). For the example test, a PropertiesImplementation was created which has a structural feature on the document root of PropsPackage.eINSTANCE.getDocumentRoot_ImplementationProperties(). So the correct feature to set using the FeatureAdapter for the PropertiesImplementation EClass instances is PropsPackage.eINSTANCE.getDocumentRoot_ImplementationProperties(). This will ensure that when the XML document is serialized, that it uses the substitution group element name ("implementation.properties") instead of using the xsi:type="props:PropertiesImplementation" format.

Specified by:
setSpecializedImplementation in interface Component
Parameters:
newImplementation - The instance of the implementation to configure this component with.
Returns:
The existing Implementation.

setAbstractImplementation

public Implementation setAbstractImplementation(ComponentType newComponentType)
Description copied from interface: Component
A convenience method to set an abstract implementation type (SCAPackage.eINSTANCE.getSCACoreRoot_ImplementationAbstract()). The serialized form will have the element name "implemenation.abstract" with a serialized, embedded ComponentType ( ...).

Specified by:
setAbstractImplementation in interface Component
Parameters:
newComponentType - The component type that should be used to configure the Abstract Implementation that will be created for this Component.
Returns:
The existing Implementation.

getState

public int getState()
Specified by:
getState in interface Component
Returns:
One of Component.STATE_ABSTRACT, Component.STATE_TYPED, or Component.STATE_IMPLEMENTED.

getType

public java.lang.String getType()
Specified by:
getType in interface Component
Returns:
The type of the underlying implementation. When Component.getState() returns Component.STATE_ABSTRACT, the type will be "implementation.abstract". Otherwise, the type will be the substitution group name of the implementation.

resolveComponentType

public ComponentType resolveComponentType()
Description copied from interface: Component
Uses the Implementation to resolve the ComponentType.

If the Implementation is abstract, then the ComponentType is an embedded element and cannot be shared. Otherwise, the ComponentType could be shared; the underlying implementation will determine if the ComponentType can be shared and handle it automatically.

The ComponentType can be shared in some cases. If the implementation introspector defines an IShareableComponentTypeFactory, then the implementation model will be converted to URI and requested through the ResourceSet of the Implementation that is supplied.

Therefore, resolve() should only be supplied implementations that are contained by a Component, which are contained by a ResourceSet. (The actual containment is Implementation > Component > Composite/Module > SCACoreRoot > Resource > ResourceSet).

The one special case is AbstractImplementation (SCAPackage.getAbstractImplementation()) which does not need to be contained to be resolved.

The feature from the implementation will be determined using the FeatureMap of the containing Component.

The containment requirement is to allow context for resolving a specialized implementation. For cases where the Component or the Implementation is not contained, use IModelIntrospectionManager.resolve(Implementation) to resolve an Implementation and explicitly supply the correct project as the context.

Specified by:
resolveComponentType in interface Component
Returns:
The ComponentType contract for this Component