|
|
|
Re: About EMF tutorial -Philmann Dark [message #1731145 is a reply to message #1731106] |
Tue, 03 May 2016 07:48 |
Felix Dorner Messages: 392 Registered: December 2015 |
Senior Member |
|
|
On 02-May-16 22:19, ima cha wrote:
> Thank you so much. Actually, I'm a beginner in using EMF and i wonder if
> this could help me to know how to use reflective interfaces, i had an
> idea about them and i need to use them in my application where i found
> a piece of code in a book but it isn't mentioned how to recuperate the
> references of package and factory ( first and second line, just comments)
>
> [1] EFactory fact = //obtention de la référence
> [2] EPackage pa = //obtention de la référence
If you know which package/factory it is, you can just use
"Packagename"Factory.eINSTANCE and "Packagename"Package.eINSTANCE. Also,
there is "Packagename"Package.Literals which has constant interface
fields for all the elements in the package.
If you do not know the package, but the package uri namespace
identifier, you can look it up in the package registry:
EPackage.Registry.INSTANCE.getEPackage()/getEFactory()
hth,
FElix
|
|
|
|
Powered by
FUDForum. Page generated in 0.08839 seconds