Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Register XMI without ECORE source (How to navigate through an XMI that is not made out of an ecore mmodel)
Register XMI without ECORE source [message #854459] Mon, 23 April 2012 21:12 Go to previous message
Juan Castel is currently offline Juan Castel
Messages: 20
Registered: April 2012
Junior Member
Hi, everyone.

I've been resolving a lot of issues here, and now I'm half way:

- after discovering a Java project by MoDisco Java Discoverer, how could I load the resultant XMI model in some XMIResource and navigate? I did so with an Ecore file.

What if I only have the XMI model?

ResourceSet resourceSet = new ResourceSetImpl();		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put
			(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());		resourceSet.getPackageRegistry().put(MyMModelPackage.eNS_URI,MyMModelPackage.eINSTANCE);
File file = new File("C:\\Users\\USER\\workspace\\mmodels\\MyMModel.ecore");
		//System.out.println(file);
		URI uri = URI.createFileURI(file.getAbsolutePath());
		//System.out.println(uri);
		Resource resource = resourceSet.getResource(uri, true);

The above code works fine, but without the Ecore file, I can't figure it out.

By the way, I got the code from MyMModel.ecore-->MyMModel.genmodel->generate test code->*tests folders; thanks to this forum.

Thank you.
 
Read Message
Read Message
Read Message
Previous Topic:EMF api - constructing XMI from XMI
Next Topic:JSP MoDisco discoverer with JSP files from Struts Project
Goto Forum:
  


Current Time: Sat May 25 20:34:53 EDT 2013

Powered by FUDForum. Page generated in 0.01667 seconds