|
Re: converting nodes [message #415232 is a reply to message #415230] |
Thu, 06 December 2007 11:46 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Tomas,
I'm sure the A is a super class of A is a typo. Probably you mean "of B
and C". Since a B and a C will be an A, I assume there's no
conversion required. I suppose you might literally mean you want to
create an instance of an A that's a copy of B or C but only with A's
feature set. In any case, I could imagine doing either direction of
the conversion by specializing EcoreUtil.Copier. This utility generally
will make a copy but you could specialize it so that copying A will
create a B or a C instead, and then allow the rest of the logic to
continue as normal. In the other direction, i.e., when copying B or C,
you'd actually create an A, and then you'd need some additional
specialization to ensure that features in B or C but not in A are ignored...
Tomas Zijdemans wrote:
> I have a somewhat rare spec I need to implement.
>
> I have three elements. A, B and C. A is a super class of both A and B.
>
> The user needs to be able to choose an A element, and then convert it
> to B or C. Similarly choose B or C and convert it to A.
>
> Is this even possible?
>
>
> Best Regards,
>
> Tomas Zijdemans
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03362 seconds