org.eclipse.gmt.umlx.alien.mapping
Class EStructuralFeatureMap<F extends org.eclipse.emf.ecore.EStructuralFeature>

java.lang.Object
  extended by org.eclipse.gmt.umlx.alien.mapping.EStructuralFeatureMap<F>
Direct Known Subclasses:
EAttributeMap, EReferenceMap

public abstract class EStructuralFeatureMap<F extends org.eclipse.emf.ecore.EStructuralFeature>
extends java.lang.Object

EStructuralFeatureMap handles the conversion between an attribute/reference of an Ecore-based meta-model and a feature of a similar alien meta-model. Access to the Ecore attribute/reference is handled by an EcoreFeatureElement. Access to the non-Ecore attribute/reference is handled by the more general AbstractFeatureElement, which may be an EcoreFeatureElement for a modeled element or an ExtensionFeatureElement for an unmodeled element to be persisted as an xmi:Extension. Derivations of this class or the FeatureElement classes support alternate behaviours. Conversions may occur in three phases for the two directions: getEcoreValue->exportValue->setAlienValue, or getAlienValue->importValue->setEcoreValue. The getEcoreValue/setEcoreValue may tidy up the Ecore access so that only one of instanceClass/TypeName, type/genericType etc are published. The exportValue/importValue perform the conversion between alien and Ecore model values. The getAlienValue/setAlienValue perform the xmi:extension access for preSave/postLoad. See EMOFMappingMetaData for a variety of irregular mappings.


Method Summary
 void exportFeature(org.eclipse.emf.ecore.EObject ecoreObject, org.eclipse.emf.ecore.EObject alienObject)
           
 java.lang.Object exportValueOrValues(org.eclipse.emf.ecore.EObject alienObject, java.lang.Object ecoreValue)
          Convert the ecoreValue to an alienValue
 org.eclipse.emf.ecore.EStructuralFeature getAlienFeature()
           
 AbstractFeatureElement<F> getAlienFeatureElement()
           
 java.lang.Object getAlienValue(org.eclipse.emf.ecore.EObject alienObject)
           
 EcoreFeatureElement<F> getEcoreFeatureElement()
           
 F getEcoreStructuralFeature()
           
 java.lang.Object getEcoreValue(org.eclipse.emf.ecore.EObject ecoreObject, boolean resolveProxies)
          Return the feature value from the Ecore model.
 void importFeature(org.eclipse.emf.ecore.EObject alienObject, org.eclipse.emf.ecore.EObject ecoreObject)
           
 java.lang.Object importValueOrValues(org.eclipse.emf.ecore.EObject alienObject, java.lang.Object alienValue)
          Convert the alienValue to an ecoreValue
 void install()
           
 boolean isSetEcore(org.eclipse.emf.ecore.EObject ecoreObject)
           
 void setAlienValue(org.eclipse.emf.ecore.EObject alienObject, java.lang.Object alienValue)
           
 void setEcoreValue(org.eclipse.emf.ecore.EObject ecoreObject, java.lang.Object ecoreValue)
           
 java.lang.String toString()
           
 void unsetEcore(org.eclipse.emf.ecore.EObject ecoreObject)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

exportFeature

public void exportFeature(org.eclipse.emf.ecore.EObject ecoreObject,
                          org.eclipse.emf.ecore.EObject alienObject)

exportValueOrValues

public java.lang.Object exportValueOrValues(org.eclipse.emf.ecore.EObject alienObject,
                                            java.lang.Object ecoreValue)
Convert the ecoreValue to an alienValue

Parameters:
ecoreValue -
Returns:

getAlienFeature

public org.eclipse.emf.ecore.EStructuralFeature getAlienFeature()

getAlienFeatureElement

public AbstractFeatureElement<F> getAlienFeatureElement()

getAlienValue

public java.lang.Object getAlienValue(org.eclipse.emf.ecore.EObject alienObject)

getEcoreFeatureElement

public EcoreFeatureElement<F> getEcoreFeatureElement()

getEcoreStructuralFeature

public F getEcoreStructuralFeature()

getEcoreValue

public java.lang.Object getEcoreValue(org.eclipse.emf.ecore.EObject ecoreObject,
                                      boolean resolveProxies)
Return the feature value from the Ecore model.

Parameters:
eObject -
Returns:

importFeature

public void importFeature(org.eclipse.emf.ecore.EObject alienObject,
                          org.eclipse.emf.ecore.EObject ecoreObject)

importValueOrValues

public java.lang.Object importValueOrValues(org.eclipse.emf.ecore.EObject alienObject,
                                            java.lang.Object alienValue)
Convert the alienValue to an ecoreValue

Parameters:
alienObject -
alienValue -
Returns:

install

public void install()

isSetEcore

public boolean isSetEcore(org.eclipse.emf.ecore.EObject ecoreObject)

setAlienValue

public void setAlienValue(org.eclipse.emf.ecore.EObject alienObject,
                          java.lang.Object alienValue)

setEcoreValue

public void setEcoreValue(org.eclipse.emf.ecore.EObject ecoreObject,
                          java.lang.Object ecoreValue)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

unsetEcore

public void unsetEcore(org.eclipse.emf.ecore.EObject ecoreObject)