Convert AnyTypeImpl to UML elements [message #627282] |
Mon, 15 December 2008 07:01 |
David BY Chan Messages: 40 Registered: July 2009 |
Member |
|
|
I loaded an UML model file(e.g. House.uml) into memory using standalone
manner.
ResourceSet rs = new ResourceSetImpl();
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().p ut(UMLResource.FILE_EXTENSION,new
UMLResourceFactoryImpl());
URI uml_model_path = URI.createFileURI("model/House.uml");
UMLResource res = (UMLResource) rs.getResource(uml_model_path,true);
TreeIterator<EObject> iter = res.getAllContents();
while (iter.hasNext())
{
EObject obj = iter.next();
System.out.println(obj.getClass().getName());
}
but the output indicated that all types are
org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl, how can I convert them
to UML model elements, such as Package, Class, Property, Operation etc..
Thanks a lot!
|
|
|
Powered by
FUDForum. Page generated in 0.03247 seconds