|[Acceleo] How to make a type cast? [message #1018839]
||Thu, 14 March 2013 14:58
| Iban Ayestaran
Registered: September 2011
I am using Acceleo with a meta-model with some inherited classes. Imagine classes 'child1' and 'child2' inherit from 'parent'.
I want to do this:
[for (_par : Parent | aModel.eAllContents()->filter(Parent))]
_par.parentattribute1 [comment write parent attributes of the class/]
[(child1) _par;/] [comment this does not work!!/]
_par.child1attribute1 [comment write child1 attributes of the class/]
[(child2) _par;/] [comment this does not work!!/]
_par.child2attribute1 [comment write child2 attributes of the class/]
As far as I know, to be able to read an attribute defined in a child class I need to cast my object to be seen by acceleo as a child class, and I do not know how to do this. I tried this in different ways, for example the one above, but this is not accepted by acceleo.
Do you know how to do it?
Powered by FUDForum
. Page generated in 0.11275 seconds