|
|
|
|
|
|
|
|
|
|
|
|
|
Re: [QVTo] Transform a unique element of the model [message #1703739 is a reply to message #1703579] |
Tue, 04 August 2015 14:36 |
Christopher Gerking Messages: 116 Registered: April 2011 |
Senior Member |
|
|
Hi
Yes, we solved this problem by generating an abstract 'doCopy' mapping per abstract base class, which copies only the class attributes. This mapping is then inherited by all subclass mappings:
mapping EClassifier :: copyEClassifier() : EClassifier
disjuncts EClass::copyEClass, EDataType::copyEDataType;
mapping EClass :: copyEClass() : EClass
inherits EClassifier::doCopyEClassifier {
eStructuralFeatures := self.eStructuralFeatures.map copyEStructuralFeature();
...
}
mapping EDataType :: copyEDataType() : EDataType
inherits EClassifier::doCopyEClassifier {
serializable := self.serializable;
}
abstract mapping EClassifier :: doCopyEClassifier() : EClassifier
inherits ENamedElement::doCopyENamedElement {
eTypeParameters := self.eTypeParameters.map copyETypeParameter();
...
}
abstract mapping ENamedElement :: doCopyENamedElement() : ENamedElement {
name := self.name;
}
What I would like to do is using disjuncts/inherits together:
mapping EClassifier :: copyEClassifier() : EClassifier
inherits EClassifier::doCopyEClassifier
disjuncts EClass::copyEClass, EDataType::copyEDataType;
But that's not supported by Eclipse QVTo.
[Updated on: Wed, 05 August 2015 08:38] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.05367 seconds