Continuing saga of the standalone app [message #626808] |
Thu, 17 July 2008 20:14 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.02171 seconds