[EMFTVM/ATL/SimpleGT] XMI Model injector and extractor [message #1727513] |
Wed, 23 March 2016 12:24 |
Zheng Cheng Messages: 15 Registered: February 2012 |
Junior Member |
|
|
Hi All,
Sometimes, we have the need to extract a model version of ATL/SimpleGT transformation, e.g. an ATL transformation that transforms ATL/SimpleGT to EMFTVM requires an ATL/SimpleGT input model.
My tool tries to do some static analysis on ATL/SimpleGT transformations. ATL provides some facilities to generate a model version of ATL. I wonder how can I get a model version of SimpleGT?
Consult SimpleGT source code, I did something like this:
ResourceSet rs = new ResourceSetImpl();
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("simplegt", new SimplegtResourceFactory());
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
URI uri = URI.createURI(filePath);
SimplegtResource resource = (SimplegtResource) rs.getResource(uri, true);
Model simplegtm = EmftvmFactory.eINSTANCE.createModel();
simplegtm.setResource(resource);
This probably enough for me. But I wonder can I serialize this model *simplegtm* as XMI model? e.g. can I using a EMFExtractor?
Thanks in advance.
Best,
Zheng
[Updated on: Wed, 23 March 2016 12:34] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02792 seconds