|
|
Re: java package of an EPackage [message #502836 is a reply to message #502817] |
Wed, 09 December 2009 20:52 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
Hi Ed,
Just out of curiosity, if you have: ePackage.getClass()
why do you need to get the field? Can't you just use the
ePackage.getClass()? Or is it possible that ePackage is not the package
class itself but a subclass that doesn't have the eINSTANCE field in it,
but inherits it?
Ed Merks wrote:
> Gary,
>
> There are no utilities for doing this. Here's a simpler idiom we us in
> XMLSaveImpl:
>
--
Thanks,
Rich Kulp
|
|
|
Re: java package of an EPackage [message #502840 is a reply to message #502836] |
Wed, 09 December 2009 21:10 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Rich,
Comments below.
Rich Kulp wrote:
> Hi Ed,
>
> Just out of curiosity, if you have: ePackage.getClass()
>
> why do you need to get the field? Can't you just use the
> ePackage.getClass()?
This will get org.example.xyz.impl.XyzPackageImpl, i.e., the internal
implementation of the package, when we want org.example.xyz.XyzPackage,
i.e., the public API for the package.
> Or is it possible that ePackage is not the package class itself but a
> subclass that doesn't have the eINSTANCE field in it, but inherits it?
Yes. :-P
>
> Ed Merks wrote:
>> Gary,
>>
>> There are no utilities for doing this. Here's a simpler idiom we us
>> in XMLSaveImpl:
>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03224 seconds