basic question: how to load a uml model? [message #621678] |
Fri, 15 June 2007 01:56 |
Leila Naslavsky Messages: 13 Registered: July 2009 |
Junior Member |
|
|
Hi All,
I'm trying to load a uml file programmatically, running a standalone Java
application.
I'm running Eclipse SDK 3.3.0 build I20070601-1539
I'm using the example in the "UML2Article" (I call
registerResourceFactories(), and registerPathmaps(URI uri), and load(URI
uri)).
My uml model has only one 'Model' and one 'Class'.
The resources are loaded, because when I call resource.getAllContents()
and print it, I get:
org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@a3aa2c (eClass:
org.eclipse.emf.ecore.impl.EClassImpl@f95165 (name: Model)
(instanceClassName: null) (abstract: false, interface: false)) (mixed:
[ecore.xml.type:text=
, packagedElement=org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@ed1dbe
(eClass: org.eclipse.emf.ecore.impl.EClassImpl@3bc1a1 (name: Class)
(instanceClassName: null) (abstract: false, interface: false)) (mixed: [],
anyAttribute: [name=Minha Classe]), ecore.xml.type:text=
], anyAttribute: [name=Meu Modelo])
but when I call
package_ = (org.eclipse.uml2.uml.Package)
EcoreUtil.getObjectByType(resource.getContents(),UMLPackage. Literals.PACKAGE);
The package_ is null.
I understand the resources are not UML (type) resources. But I don't know
how to fix this.
I've seen the posts in this newsgroup, and (apparently) I'm doing what I
should...
Could anyone help me with this?
Thanks,
- Leila
|
|
|
Powered by
FUDForum. Page generated in 0.03667 seconds