Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search


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;"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