|
Re: Loading Resource file [message #1805880 is a reply to message #1805856] |
Fri, 26 April 2019 11:58 |
|
Hello
First you have to register your file extension:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(<your file extension>, new XMIResourceFactoryImpl());
You can use XMIResourceFactoryImpl if you don't have your own factory.
In your case <your file extension>= "mydsl"
Then when creating the resource from a ResourceSet, EMF will find the factory from the Registry
So you just have to write the code below
ResourceSetImpl rs = new ResourceSetImpl();
Resource r = rs.createResource(fileURI);
Regards
Laurent
Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.12666 seconds