retrieving stereotypes [message #39599] |
Mon, 01 October 2007 03:31  |
Eclipse User |
|
|
|
Originally posted by: firstname.name.gmail.com
Hello,
I would like to know how to retrieve applied stereotype to a model element in a
OCL way. I know that a element my navigate to a stereotype with the
extension_MyStereotype role, but how to do that if we want to query all
stereotypes. A solution may be to look at all properties starting by
"extension_" but this is a non-navigable association...
thanks.
--
F. Lagarde
|
|
|
Re: retrieving stereotypes [message #39693 is a reply to message #39599] |
Mon, 01 October 2007 09:43  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, François,
Generically finding all extensions would require reflection capabilities
that OCL does not offer. To do what you need, you would have to create a
custom Environment implementation that adds some additional operation
implemented in Java using the UML2 API. Of course, you will have to
declare a result type for such an operation, which implies that your
stereotypes all have some common ancestor other than OclAny in order for
this to be useful.
Cheers,
Christian
François Lagarde wrote:
> Hello,
>
> I would like to know how to retrieve applied stereotype to a model element
> in a
> OCL way. I know that a element my navigate to a stereotype with the
> extension_MyStereotype role, but how to do that if we want to query all
> stereotypes. A solution may be to look at all properties starting by
> "extension_" but this is a non-navigable association...
>
> thanks.
>
|
|
|
Powered by
FUDForum. Page generated in 0.11580 seconds