Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » basic question: how to load a uml model?
basic question: how to load a uml model? [message #621678] Fri, 15 June 2007 01:56
Leila Naslavsky is currently offline Leila NaslavskyFriend
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
Previous Topic:[Announce] MDT UML2 2.1.0 2.1RC3 is available
Next Topic:Default value "*" of tag with type UnlimitedNatural gets lost
Goto Forum:
  


Current Time: Thu Apr 25 15:25:57 GMT 2024

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

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

Back to the top