|
Re: [EDAPT] EFactory questions [message #1711248 is a reply to message #1711028] |
Wed, 14 October 2015 10:10 |
Maximilian Koegel Messages: 253 Registered: July 2009 |
Senior Member |
|
|
Hi Brad,
sorry for the delayed reply. Johannes will get back to you today or tomorrow.
Cheers,
Maximilian
On 12.10.2015 15:28, Brad Schneider wrote:
> I am wondering if someone could explain a bit about how Edapt chooses an appropriate EFactory for
> loading an out-dated model during migration. From what I can tell at runtime, a default EFactoryImpl
> is being used. However, we have extra logic in our EFactory for the createFromString method, so I
> need a custom implementation.
>
> I'm trying to find if there is a "correct" or "most appropriate" way of handling this provided by
> the framework. If there is not a built-in method for handling this, will it be enough to retain a
> base version of the factory with the enhanced createFromString method, and register that to the old
> namespace URI(s) before migration? I haven't been able to find where the specific version of the
> EFactory to use for loading the old model is being set. Conceptually, I'm not certain on how I
> should expect Edapt to be able to handle this.
>
> Thanks for your help!
--
Maximilian Koegel
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
|
|
Re: [EDAPT] EFactory questions [message #1713517 is a reply to message #1711374] |
Wed, 04 November 2015 17:45 |
Brad Schneider Messages: 4 Registered: July 2015 |
Junior Member |
|
|
I hate to revive an old thread, but I just realized that this appears to apply only to "top level" packages. For a sub-package within an EPackage inside of a metamodel, it is not possible to use the extension point to override the EFactory. Is this true? Is there a different way to accomplish this?
EDIT: Here's the code I'm referring to in Persistency.class:
for (final EObject element : resource.getContents()) {
if (element instanceof EPackage) {
final EPackage ePackage = (EPackage) element;
FactoryHelper.INSTANCE.overrideFactory(ePackage);
metamodelResource.getRootPackages().add(ePackage);
}
}
That is only iterating over top-level EPackages in the metamodel, and the call to FactoryHelper.overrideFactory(EPackage ePackage) does not iterate over sub-packages for the EPackage, either.
[Updated on: Wed, 04 November 2015 17:53] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03516 seconds