finding all specializations of a classifier [message #473028] |
Tue, 29 May 2007 17:02  |
Eclipse User |
|
|
|
Is there any EMF or UML2 utility or trick for finding all
specializations of a classifier? I will only search among models loaded
in the same ResourceSet. I am wondering if there is something more
efficient than a UMLSwitch that tests all Generalizations in the tree
iterator.
Thanks!
Dave Carlson
|
|
|
|
Re: finding all specializations of a classifier [message #473031 is a reply to message #473029] |
Tue, 29 May 2007 17:59  |
Eclipse User |
|
|
|
Thanks, James, exactly what I was looking for. I can always count on
the UML2 newsgroup for a lightening fast response :-)
Dave
James Bruck wrote:
> Hi Dave,
>
> I belive you could do something like ...
>
> myClassifier.getTargetDirectedRelationships(UMLPackage.Liter als.GENERALIZATI
> ON);
>
> .. then call getSources() from all those relationships. That should give
> you all the elements that directly specialize your classifier.
>
> You might also want to look at Element.getRelationships(...).
>
> Hope that helps.
>
> - James
|
|
|
Re: finding all specializations of a classifier [message #618177 is a reply to message #473028] |
Tue, 29 May 2007 17:29  |
Eclipse User |
|
|
|
Hi Dave,
I belive you could do something like ...
myClassifier.getTargetDirectedRelationships(UMLPackage.Liter als.GENERALIZATI
ON);
... then call getSources() from all those relationships. That should give
you all the elements that directly specialize your classifier.
You might also want to look at Element.getRelationships(...).
Hope that helps.
- James
"Dave Carlson" <dcarlson@xmlmodeling.com> wrote in message
news:f3i4dr$nic$1@build.eclipse.org...
> Is there any EMF or UML2 utility or trick for finding all
> specializations of a classifier? I will only search among models loaded
> in the same ResourceSet. I am wondering if there is something more
> efficient than a UMLSwitch that tests all Generalizations in the tree
> iterator.
>
> Thanks!
> Dave Carlson
|
|
|
Re: finding all specializations of a classifier [message #618179 is a reply to message #473029] |
Tue, 29 May 2007 17:59  |
Eclipse User |
|
|
|
Thanks, James, exactly what I was looking for. I can always count on
the UML2 newsgroup for a lightening fast response :-)
Dave
James Bruck wrote:
> Hi Dave,
>
> I belive you could do something like ...
>
> myClassifier.getTargetDirectedRelationships(UMLPackage.Liter als.GENERALIZATI
> ON);
>
> .. then call getSources() from all those relationships. That should give
> you all the elements that directly specialize your classifier.
>
> You might also want to look at Element.getRelationships(...).
>
> Hope that helps.
>
> - James
|
|
|
Powered by
FUDForum. Page generated in 0.07967 seconds