diff options
Diffstat (limited to 'plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java')
-rw-r--r-- | plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java index 0f5b81fb4..3fd04fdfb 100644 --- a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java +++ b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java @@ -19,6 +19,7 @@ import java.util.Set; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.EcoreUtil.Copier; @@ -68,6 +69,7 @@ import org.eclipse.qvtd.codegen.qvti.java.QVTiCodeGenerator; import org.eclipse.qvtd.codegen.qvti.java.QVTiGlobalContext; import org.eclipse.qvtd.codegen.qvticgmodel.CGConnectionAssignment; import org.eclipse.qvtd.codegen.qvticgmodel.CGConnectionVariable; +import org.eclipse.qvtd.codegen.qvticgmodel.CGEcoreContainerAssignment; import org.eclipse.qvtd.codegen.qvticgmodel.CGEcorePropertyAssignment; import org.eclipse.qvtd.codegen.qvticgmodel.CGEcoreRealizedVariable; import org.eclipse.qvtd.codegen.qvticgmodel.CGFunction; @@ -844,6 +846,21 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit System.out.println("Missing getAccessor for " + eStructuralFeature + "ignored."); } } + else { + Property asOppositeProperty = asTargetProperty.getOpposite(); + eStructuralFeature = (EStructuralFeature) (asOppositeProperty != null ? asOppositeProperty.getESObject() : null); + if (eStructuralFeature != null) { + assert ((EReference)eStructuralFeature).isContainment(); + try { + genModelHelper.getGetAccessor(eStructuralFeature); + CGEcoreContainerAssignment cgEcoreContainerAssignment = QVTiCGModelFactory.eINSTANCE.createCGEcoreContainerAssignment(); + cgEcoreContainerAssignment.setEStructuralFeature(eStructuralFeature); + cgPropertyAssignment = cgEcoreContainerAssignment; + } catch (GenModelException e) { + System.out.println("Missing getAccessor for " + eStructuralFeature + "ignored."); + } + } + } } if (cgPropertyAssignment == null) { cgPropertyAssignment = QVTiCGModelFactory.eINSTANCE.createCGPropertyAssignment(); |