|
Re: Create Ecore file programmatically with unique id for every elements [message #1446631 is a reply to message #1446413] |
Fri, 17 October 2014 04:54 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
You'd need to to have a specialized factory that creates a specialized
XMIResourceImpl that overrides this method to return true.
protected boolean useUUIDs()
{
return false;
}
On 16/10/2014 10:25 PM, UmaShankar Subramani wrote:
> Hi all,
>
> I am creating ecore file programmatically by using the code as
> follows. But I want to introduce unique ids for all the elements in
> the generated ecore file. The id should be something similiar to the
> XMI ID .
>
> ResourceSet resourceSet = new ResourceSetImpl();
> resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put
> ("*", new XMIResourceFactoryImpl());
> Resource resource =
> resourceSet.createResource(URI.createURI("file://D:/send.ecore"));
>
> resource.add(eObject);
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
> <ecore:EOperation/>
> <ecore:EOperation/>
> <ecore:EAttribute/>
> </xmi:XMI>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02709 seconds