Resolving Elements in a different Resource [message #626422] |
Thu, 17 April 2008 18:33 |
Felix Dorner Messages: 676 Registered: July 2009 |
Senior Member |
|
|
Hey,
I load a UML Model with this (Getting Started Tutorial #2 Code):
public static org.eclipse.uml2.uml.Model load(URI uri) {
ResourceSet rs = new ResourceSetImpl();
rs.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
org.eclipse.uml2.uml.Model model = null;
try {
Resource resource = rs.getResource(uri, true);
model = (org.eclipse.uml2.uml.Model) EcoreUtil
.getObjectByType(resource.getContents(),
UMLPackage.Literals.MODEL);
} catch (WrappedException we) {
we.printStackTrace();
}
return model;
}
catch {...}
The model contains a Class with a Property whose Type is defined in another Resource.
If I now navigate to this Property and ask for "getType().getQualifiedName()", it returns
null, so it seems like there is something wrong with the resolver, but I have no clue..
Here's the relevant part of the input model:
<packagedElement xmi:type="uml:Class" xmi:id="_e6BZ8ArOEd2e0rP7R-gUuQ" name="User">
<ownedAttribute xmi:id="_gN7R0ArOEd2e0rP7R-gUuQ" name="name">
<type xmi:type="uml:Class" href="../../../../model/allure.uml#_rAxscAynEd2RB6PoibfsgQ"/ >
</ownedAttribute>
</packagedElement>
</packagedElement>
Thanks for any help,
Felix
|
|
|
Powered by
FUDForum. Page generated in 0.04254 seconds