Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Get implements interfaces, and subclasses from uml element(Get implements interfaces, and subclasses from uml element)
Get implements interfaces, and subclasses from uml element [message #661179] Wed, 23 March 2011 13:41 Go to next message
Andres  is currently offline Andres
Messages: 57
Registered: July 2010
Member
Hello,
how can i know the classes that an Uml element (class type )extends, and the interfaces that the type implements.

For example if i have a class X that extends a class A, and implements Interface I, and i have uml element with types X.
How can get this values(A,I) from the uml element type X?

Can you help me?


Thanks,
Andres
Re: Get implements interfaces, and subclasses from uml element [message #661240 is a reply to message #661179] Wed, 23 March 2011 16:27 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Once you have the class at hand (org.eclipse.uml2.uml.Class):

#getSuperClasses()

#getImplementedInterfaces()

Doesn't get any easier than that...

If you have a property:

Class myPropertyType = (Class) myProperty.getType();

Cheers,

Rafael
http://abstratt.com/blog

[Updated on: Wed, 23 March 2011 16:28]

Report message to a moderator

Re: Get implements interfaces, and subclasses from uml element [message #661329 is a reply to message #661179] Thu, 24 March 2011 09:45 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad Varnica
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
If you are a developer then Rafael answer is exactly what you need.

If you are a modeler then the easiest is to use an existing tool. You can graphically create implementation or reverse existing code.
Topcased can detect implementation from the code but all code information will not be saved in the model and it would be really painful to create views from a model. If you are lazy and have budget then just use EclipseUML Omondo because it would do the job for you.

You will spend more playing Golf or being with your family and let other lads work late in the evening to do what already exist.
Don't forget that your company will not give any gratitude if you save them software purchase because this is another budget !!

[Updated on: Thu, 24 March 2011 09:46]

Report message to a moderator

Re: Get implements interfaces, and subclasses from uml element [message #661376 is a reply to message #661179] Thu, 24 March 2011 12:56 Go to previous messageGo to next message
Thomas Neustupny is currently offline Thomas Neustupny
Messages: 75
Registered: October 2009
Member
Smile

Personally I enjoyed reading your answer, Vlad. May I humbly ask if these kind of postings begun your special friendship with Mr. Merks?
Re: Get implements interfaces, and subclasses from uml element [message #661490 is a reply to message #661329] Thu, 24 March 2011 22:16 Go to previous message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
On that note, if you are not a developer, this is probably not the right forum for you, as UML2 is essentially an API, with no (significant) user-facing features.
Previous Topic:uml (middleweight) metamodel extension
Next Topic:The type org.eclipse.emf.ecore.EModelElement cannot be resolved.
Goto Forum:
  


Current Time: Wed Oct 22 08:12:41 GMT 2014

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

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