diff options
author | Ed Willink | 2016-03-23 15:59:11 +0000 |
---|---|---|
committer | Ed Willink | 2016-03-23 17:38:44 +0000 |
commit | 2eba97e4dd0e9ae43b67ed0bfe2981f0ba93706c (patch) | |
tree | 33359b5da4410823aa9534ffb10db80ea12296ea | |
parent | 6a3a565c0eda4c17043528f04d32023892667b96 (diff) | |
download | org.eclipse.qvtd-2eba97e4dd0e9ae43b67ed0bfe2981f0ba93706c.tar.gz org.eclipse.qvtd-2eba97e4dd0e9ae43b67ed0bfe2981f0ba93706c.tar.xz org.eclipse.qvtd-2eba97e4dd0e9ae43b67ed0bfe2981f0ba93706c.zip |
[490172] Add Mapping.ownedKeyExpression to AS
6 files changed, 138 insertions, 2 deletions
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcore/src/org/eclipse/qvtd/pivot/qvtcore/utilities/QVTcoreDomainUsageAnalysis.java b/plugins/org.eclipse.qvtd.pivot.qvtcore/src/org/eclipse/qvtd/pivot/qvtcore/utilities/QVTcoreDomainUsageAnalysis.java index 8aed3fa78..492355617 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtcore/src/org/eclipse/qvtd/pivot/qvtcore/utilities/QVTcoreDomainUsageAnalysis.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtcore/src/org/eclipse/qvtd/pivot/qvtcore/utilities/QVTcoreDomainUsageAnalysis.java @@ -17,7 +17,6 @@ import org.eclipse.qvtd.pivot.qvtbase.Rule; import org.eclipse.qvtd.pivot.qvtcore.CoreModel; import org.eclipse.qvtd.pivot.qvtcore.Mapping; import org.eclipse.qvtd.pivot.qvtcore.util.QVTcoreVisitor; -import org.eclipse.qvtd.pivot.qvtcorebase.RealizedVariable; import org.eclipse.qvtd.pivot.qvtcorebase.analysis.DomainUsage; import org.eclipse.qvtd.pivot.qvtcorebase.analysis.RootDomainUsageAnalysis; diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/Mapping.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/Mapping.java index 43def420f..43d859b11 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/Mapping.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/Mapping.java @@ -11,6 +11,7 @@ package org.eclipse.qvtd.pivot.qvtimperative; import org.eclipse.emf.common.util.EList; +import org.eclipse.ocl.pivot.OCLExpression; import org.eclipse.qvtd.pivot.qvtcorebase.AbstractMapping; /** @@ -30,6 +31,7 @@ import org.eclipse.qvtd.pivot.qvtcorebase.AbstractMapping; * <ul> * <li>{@link org.eclipse.qvtd.pivot.qvtimperative.Mapping#getMappingStatement <em>Mapping Statement</em>}</li> * <li>{@link org.eclipse.qvtd.pivot.qvtimperative.Mapping#getPolledClasses <em>Polled Classes</em>}</li> + * <li>{@link org.eclipse.qvtd.pivot.qvtimperative.Mapping#getOwnedKeyExpression <em>Owned Key Expression</em>}</li> * </ul> * * @see org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage#getMapping() @@ -76,6 +78,31 @@ public interface Mapping extends AbstractMapping, ImperativeArea { EList<org.eclipse.ocl.pivot.Class> getPolledClasses(); /** + * Returns the value of the '<em><b>Owned Key Expression</b></em>' containment reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Owned Key Expression</em>' containment reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Owned Key Expression</em>' containment reference. + * @see #setOwnedKeyExpression(OCLExpression) + * @see org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage#getMapping_OwnedKeyExpression() + * @generated + */ + OCLExpression getOwnedKeyExpression(); + + /** + * Sets the value of the '{@link org.eclipse.qvtd.pivot.qvtimperative.Mapping#getOwnedKeyExpression <em>Owned Key Expression</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Owned Key Expression</em>' containment reference. + * @see #getOwnedKeyExpression() + * @generated + */ + void setOwnedKeyExpression(OCLExpression value); + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/QVTimperativePackage.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/QVTimperativePackage.java index 927cf047b..fb9463a9a 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/QVTimperativePackage.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/QVTimperativePackage.java @@ -1134,13 +1134,22 @@ public interface QVTimperativePackage extends EPackage { int MAPPING__POLLED_CLASSES = QVTcoreBasePackage.ABSTRACT_MAPPING_FEATURE_COUNT + 3; /** + * The feature id for the '<em><b>Owned Key Expression</b></em>' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MAPPING__OWNED_KEY_EXPRESSION = QVTcoreBasePackage.ABSTRACT_MAPPING_FEATURE_COUNT + 4; + + /** * The number of structural features of the '<em>Mapping</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - int MAPPING_FEATURE_COUNT = QVTcoreBasePackage.ABSTRACT_MAPPING_FEATURE_COUNT + 4; + int MAPPING_FEATURE_COUNT = QVTcoreBasePackage.ABSTRACT_MAPPING_FEATURE_COUNT + 5; /** * The meta object id for the '{@link org.eclipse.qvtd.pivot.qvtimperative.impl.MappingCallImpl <em>Mapping Call</em>}' class. @@ -1865,6 +1874,17 @@ public interface QVTimperativePackage extends EPackage { EReference getMapping_PolledClasses(); /** + * Returns the meta object for the containment reference '{@link org.eclipse.qvtd.pivot.qvtimperative.Mapping#getOwnedKeyExpression <em>Owned Key Expression</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference '<em>Owned Key Expression</em>'. + * @see org.eclipse.qvtd.pivot.qvtimperative.Mapping#getOwnedKeyExpression() + * @see #getMapping() + * @generated + */ + EReference getMapping_OwnedKeyExpression(); + + /** * Returns the meta object for class '{@link org.eclipse.qvtd.pivot.qvtimperative.MappingCall <em>Mapping Call</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2212,6 +2232,14 @@ public interface QVTimperativePackage extends EPackage { EReference MAPPING__POLLED_CLASSES = eINSTANCE.getMapping_PolledClasses(); /** + * The meta object literal for the '<em><b>Owned Key Expression</b></em>' containment reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MAPPING__OWNED_KEY_EXPRESSION = eINSTANCE.getMapping_OwnedKeyExpression(); + + /** * The meta object literal for the '{@link org.eclipse.qvtd.pivot.qvtimperative.impl.MappingCallImpl <em>Mapping Call</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/MappingImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/MappingImpl.java index 9ccda14ec..2475740a9 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/MappingImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/MappingImpl.java @@ -20,6 +20,7 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectResolvingEList; import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.ocl.pivot.OCLExpression; import org.eclipse.ocl.pivot.Property; import org.eclipse.ocl.pivot.Variable; import org.eclipse.ocl.pivot.util.Visitor; @@ -49,6 +50,7 @@ import org.eclipse.qvtd.pivot.qvtimperative.util.QVTimperativeVisitor; * <li>{@link org.eclipse.qvtd.pivot.qvtimperative.impl.MappingImpl#getEnforcedProperties <em>Enforced Properties</em>}</li> * <li>{@link org.eclipse.qvtd.pivot.qvtimperative.impl.MappingImpl#getMappingStatement <em>Mapping Statement</em>}</li> * <li>{@link org.eclipse.qvtd.pivot.qvtimperative.impl.MappingImpl#getPolledClasses <em>Polled Classes</em>}</li> + * <li>{@link org.eclipse.qvtd.pivot.qvtimperative.impl.MappingImpl#getOwnedKeyExpression <em>Owned Key Expression</em>}</li> * </ul> * * @generated @@ -115,6 +117,16 @@ public class MappingImpl extends RuleImpl implements Mapping { protected EList<org.eclipse.ocl.pivot.Class> polledClasses; /** + * The cached value of the '{@link #getOwnedKeyExpression() <em>Owned Key Expression</em>}' containment reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOwnedKeyExpression() + * @generated + * @ordered + */ + protected OCLExpression ownedKeyExpression; + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -313,6 +325,51 @@ public class MappingImpl extends RuleImpl implements Mapping { * @generated */ @Override + public OCLExpression getOwnedKeyExpression() { + return ownedKeyExpression; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetOwnedKeyExpression(OCLExpression newOwnedKeyExpression, NotificationChain msgs) { + OCLExpression oldOwnedKeyExpression = ownedKeyExpression; + ownedKeyExpression = newOwnedKeyExpression; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION, oldOwnedKeyExpression, newOwnedKeyExpression); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void setOwnedKeyExpression(OCLExpression newOwnedKeyExpression) { + if (newOwnedKeyExpression != ownedKeyExpression) { + NotificationChain msgs = null; + if (ownedKeyExpression != null) + msgs = ((InternalEObject)ownedKeyExpression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION, null, msgs); + if (newOwnedKeyExpression != null) + msgs = ((InternalEObject)newOwnedKeyExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION, null, msgs); + msgs = basicSetOwnedKeyExpression(newOwnedKeyExpression, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION, newOwnedKeyExpression, newOwnedKeyExpression)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EList<Mapping> getAllMappings() { // TODO: implement this method // Ensure that you remove @generated or mark it @generated NOT @@ -365,6 +422,8 @@ public class MappingImpl extends RuleImpl implements Mapping { return basicSetBottomPattern(null, msgs); case QVTimperativePackage.MAPPING__MAPPING_STATEMENT: return basicSetMappingStatement(null, msgs); + case QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION: + return basicSetOwnedKeyExpression(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -389,6 +448,8 @@ public class MappingImpl extends RuleImpl implements Mapping { return getMappingStatement(); case QVTimperativePackage.MAPPING__POLLED_CLASSES: return getPolledClasses(); + case QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION: + return getOwnedKeyExpression(); } return super.eGet(featureID, resolve, coreType); } @@ -423,6 +484,9 @@ public class MappingImpl extends RuleImpl implements Mapping { getPolledClasses().clear(); getPolledClasses().addAll((Collection<? extends org.eclipse.ocl.pivot.Class>)newValue); return; + case QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION: + setOwnedKeyExpression((OCLExpression)newValue); + return; } super.eSet(featureID, newValue); } @@ -453,6 +517,9 @@ public class MappingImpl extends RuleImpl implements Mapping { case QVTimperativePackage.MAPPING__POLLED_CLASSES: getPolledClasses().clear(); return; + case QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION: + setOwnedKeyExpression((OCLExpression)null); + return; } super.eUnset(featureID); } @@ -477,6 +544,8 @@ public class MappingImpl extends RuleImpl implements Mapping { return mappingStatement != null; case QVTimperativePackage.MAPPING__POLLED_CLASSES: return polledClasses != null && !polledClasses.isEmpty(); + case QVTimperativePackage.MAPPING__OWNED_KEY_EXPRESSION: + return ownedKeyExpression != null; } return super.eIsSet(featureID); } diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/QVTimperativePackageImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/QVTimperativePackageImpl.java index a4ad6c443..1f125669b 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/QVTimperativePackageImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/QVTimperativePackageImpl.java @@ -371,6 +371,16 @@ public class QVTimperativePackageImpl extends EPackageImpl implements QVTimperat * @generated */ @Override + public EReference getMapping_OwnedKeyExpression() { + return (EReference)mappingEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override public EClass getMappingCall() { return mappingCallEClass; } @@ -587,6 +597,7 @@ public class QVTimperativePackageImpl extends EPackageImpl implements QVTimperat mappingEClass = createEClass(MAPPING); createEReference(mappingEClass, MAPPING__MAPPING_STATEMENT); createEReference(mappingEClass, MAPPING__POLLED_CLASSES); + createEReference(mappingEClass, MAPPING__OWNED_KEY_EXPRESSION); mappingCallEClass = createEClass(MAPPING_CALL); createEReference(mappingCallEClass, MAPPING_CALL__BINDING); @@ -688,6 +699,7 @@ public class QVTimperativePackageImpl extends EPackageImpl implements QVTimperat initEClass(mappingEClass, Mapping.class, "Mapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getMapping_MappingStatement(), this.getMappingStatement(), null, "mappingStatement", null, 0, 1, Mapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getMapping_PolledClasses(), thePivotPackage.getClass_(), null, "polledClasses", null, 0, -1, Mapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getMapping_OwnedKeyExpression(), thePivotPackage.getOCLExpression(), null, "ownedKeyExpression", null, 0, 1, Mapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); addEOperation(mappingEClass, this.getMapping(), "getAllMappings", 0, -1, IS_UNIQUE, !IS_ORDERED); diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel index e7dca315d..1a4b87d76 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/model/QVTimperative.genmodel @@ -38,6 +38,7 @@ <genClasses ecoreClass="QVTimperative.ecore#//Mapping"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/mappingStatement"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/polledClasses"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference QVTimperative.ecore#//Mapping/ownedKeyExpression"/> <genOperations ecoreOperation="QVTimperative.ecore#//Mapping/getAllMappings"/> </genClasses> <genClasses ecoreClass="QVTimperative.ecore#//MappingCall"> |