[Xcore+Standalone]? Type of EAttributes always EJavaObject [message #1783464] |
Tue, 13 March 2018 11:39 |
|
I have a similar problem as discussed in this post , but I am trying to do it from standalone java.
This is my standalone Xcore setup:
new org.eclipse.emf.mwe.utils.StandaloneSetup().setPlatformUri("../");
Injector injector = new XcoreStandaloneSetup().createInjectorAndDoEMFRegistration();
XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
And then I load an xcore file like so:
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getURIConverter().getURIMap().putAll(EcorePlugin.computePlatformURIMap(true));
Resource metamodel = resourceSet.getResource(locationURI, true);
metamodel.load(Collections.EMPTY_MAP);
EcoreUtil.resolveAll(metamodel);
The location uri is a path to a file in the system, i.e. "file:/some/path/myxcore.xcore"
Note that the xcore loads correctly and I can access the EPackage. Is just that it seems the proxies where not resolved.
As with the referenced post the issues is that all attributes have a EJavaObject type, which causes any model that conforms to the metamodel not to load correctly.
To answer some of the questions of the other post:
Quote:
After you've loaded the resource is the Ecore.genmodel in the resource set?
After resourceSet.getResource only the XPackageImpl exists in the resource. Same after load. The genModel and EPackage only appear after the resolveAll.
I am inclined to think that the ECore Package is not found when resolving proxies, which means I am missing something in the standalone setup. But I can't figure out what.
Thanks,
Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05202 seconds