Re: Navigating on UML metamodel [message #628239] |
Mon, 22 February 2010 13:17  |
Eclipse User |
|
|
|
I think it's best to ask about UML specific details on the UML2
newsgroup, which I've added to the "to" list of the reply, so no need to
repost.
CaribeanAlien wrote:
> Hi,
>
> I would like to create a standalone program able to display the list
> of elements available inside of the UML metamodel. To do this, I've
> tried to register into the resourceSet the path to the UML jar
> (org.eclipse.uml2.uml.resources_2.2.0.v200805131030.jar), as shown in
> the FAQ. Then, my thought was to access to the resource representing
> the UML Metamodel :
> Resource res =
> _resourceSet.getResource(URI.createURI(UMLResource.UML_METAM
> ODEL_URI), true);
> and to navigate over it.
>
> I didn't get error, but unexpected results. When I display elements
> name, It seems to be all the same. A lot of MetaElement, ... But no
> access to the real name! It seems to be a real mess. Does anyone has
> an idea?
> here is the test code I'm working on : http://www.pastebin.com/f44dc1608
>
> I'm currently waiting for the EMF book, hoping this to help me. Thanks
> in advance for any help!
|
|
|
Re: Navigating on UML metamodel [message #628240 is a reply to message #628239] |
Mon, 22 February 2010 14:34  |
Eclipse User |
|
|
|
You need to parse the .uml file. which is in your Package Explorer.
First identify how is saved the name of the element in the xmi then just make a query directly on the xml.
I think it is more simple to query the metamodel once it has been already created than during the creation stage :p
|
|
|
Powered by
FUDForum. Page generated in 0.03375 seconds