Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Continuing saga of the standalone app
Continuing saga of the standalone app [message #626808] Thu, 17 July 2008 20:14
Eclipse UserFriend
Originally posted by: jlansing.spawar.navy.mil

It is possible to find on this list a working code snippet showing how to
get an org.eclipse.uml2.uml.Package from a .uml file, in a standalone app.

My problem occurs when that Package has an imported package that has a
"pathmap" URL.

I think what I should do is map the pathmap URL to the actual URL, like
this:
Map<URI, URI> uriMap = RESOURCE_SET.getURIConverter().getURIMap();

URI pathmap =
URI.createURI("pathmap://XMLmodeling_LIBRARIES/XSDDataTypes.library.uml");

URI types = URI.createFileURI(new File(typesFilename).getAbsolutePath());

uriMap.put(pathmap, types);

But when I try to get the imported stuff, like this:
EList<Package> importList = model.getImportedPackages();

I get an exception:
java.lang.ClassCastException:
org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl cannot be cast to
org.eclipse.uml2.uml.Package
at
org.eclipse.uml2.uml.internal.impl.PackageImportImpl.getImpo rtedPackage(PackageImportImpl.java:204)

at
org.eclipse.uml2.uml.internal.operations.NamespaceOperations .getImportedPackages(NamespaceOperations.java:207)

at
org.eclipse.uml2.uml.internal.impl.NamespaceImpl.getImported Packages(NamespaceImpl.java:552)


(Similarly if I try to use EcoreUtil.resolveAll(resource); ). It looks like
it doesn't know that the imported package is UML.

Any help on this? Thanks.
Previous Topic:Code assist for uml2 packages doesn't work
Next Topic:Code generator problem with redefinitions
Goto Forum:
  


Current Time: Wed Apr 24 23:56:49 GMT 2024

Powered by FUDForum. Page generated in 0.02648 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top