Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Talk:MDT/UML2/FAQ

What's required to load a UML (.uml) resource from a standalone application?

That’s a lot of code. Isn’t the following enough?

ResourceSet resS = new ResourceSetImpl();
resS.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", XMI2UMLResource.Factory.INSTANCE);

I was able to use it via:

Resource resource = resS.getResource(URI.createFileURI("/path/to/file.xmi"), true);
if (resource instanceof XMI2UMLResourceImpl) {
  XMI2UMLResource res = (XMI2UMLResource) resource;
  logger.info("XMI version (not file?): {}", res.getXMIVersion());
  EList<EObject> list = res.getContents();
}

I don’t get what those other things are for. URIConverter? --Kissaki 14:43, 27 October 2010 (UTC)

Back to the top