|Combining EMF switch classes [message #653832]
||Fri, 11 February 2011 13:27
Registered: July 2009
I am currently extending the EMF generated switch classes to traverse my model. Since I have many model packages, I also have multiple switch classes. I have now a requirement to combine multiple switch classes.That is, I want to use "casexxx" from different switch classes. Since java doesn't support multiple inheritance, I cannot extend multiple switch classes into one. I was thinking of a EMFSwitchDelegator class which adds multiple switch classes to a list and recursively calls doSwitch() on them till a non-null is returned. This is not possible as switch classes do not implement an interface (I have to go the ugly way of calling "doSwitch()" using Java reflection).
Do you have a better idea on how to do this? Is there any particular reason why switch classes don't implement an interface?
Thanks in advance.
Powered by FUDForum
. Page generated in 0.01918 seconds