Package.getESuperPackage() returns null [message #1117256] |
Thu, 26 September 2013 04:48  |
Eclipse User |
|
|
|
Hello,
I have two EMF packages: packageA is extending packageB.
In my ecore editor, I have used 'Load Resource' to load packageB, in order to use its elements in packageA.
I would think that I could use packageA.getESuperPackage() in order to obtain packageB.
But instead I get null back.
It is easily fixed by manually overriding the method and returning the correct package, but I would like to use the proper way.
So, do I need to configure a certain property in my ecore or genmodel files to activate this behavior? Or is there something else that I am missing?
I use EMF 2.9
Thanks,
Maarten
|
|
|
|
|
Re: Package.getESuperPackage() returns null [message #1117273 is a reply to message #1117256] |
Thu, 26 September 2013 05:06   |
Eclipse User |
|
|
|
Maarten,
Comments below.
On 26/09/2013 10:48 AM, Maarten Bezemer wrote:
> Hello,
>
> I have two EMF packages: packageA is extending packageB.
Packages don't have a relation that involves extending. Perhaps you
mean packageA has EClasses that extend the EClasses in packageB, but
that's a statement about the classes not the packages.
> In my ecore editor, I have used 'Load Resource' to load packageB, in
> order to use its elements in packageA.
>
> I would think that I could use packageA.getESuperPackage() in order to
> obtain packageB.
No.
> But instead I get null back.
If packageA don't contain packageB, that's expected.
>
> It is easily fixed by manually overriding the method and returning the
> correct package, but I would like to use the proper way.
That sounds like a bad idea.
>
> So, do I need to configure a certain property in my ecore or genmodel
> files to activate this behavior?
No, your expectations are are little off.
> Or is there something else that I am missing?
Why do you think you need this?
>
> I use EMF 2.9
>
> Thanks,
> Maarten
|
|
|
|
|
Re: Package.getESuperPackage() returns null [message #1121103 is a reply to message #1117842] |
Mon, 30 September 2013 05:18  |
Eclipse User |
|
|
|
Hello Dimitris,
That is a nice thought/idea..!
It does not require modification to the generated package classes... (which I have now)
But, it does result in some overhead, as there are quite some EClasses defined...
I just realised that the *.ecore files also contain the namespaces of the used packages, if I can grab this information somehow it is easier to get hold of all 'super-packages'.
I guess I'll think about it some more.
Thanks for your suggestion!
Cheers,
Maarten
|
|
|
Powered by
FUDForum. Page generated in 0.04348 seconds