|
|
Re: Text Representation to UML2 [message #21088 is a reply to message #21057] |
Mon, 30 April 2007 16:20 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Andrew,
Yes and no. :-)
In the case that you are using the Ecore metamodel binding for OCL, then
yes, the type of 'o' is determined by EMF's reflection API:
EObject.eClass().
However, in the case of the UML metamodel binding -- which is used with EMF
models that are specified with UML, not Ecore, and are generated by MDT
UML2 (as UML2 is, itself) -- the metaclass of your element o is the
Operation class from the UML.metamodel.uml model, not the Operation EClass
from the UML.ecore model. Have a look at
OCLUMLUtil.getClassifier(EClassifier) for how this works.
Cheers,
Christian
Andrew Carton wrote:
> Nevermind, I figured it is done through the ECORE reflection. :)
>
> Andrew.
>
> Ar 28/04/2007 21:23, Scríobh Andrew Carton:
>> Hi,
>>
>> An OCL expression is text based. For example the beneath expression
>> "o.name" and "o.visibility". How exactly does OCL map these text-based
>> representations into UML datatypes? Could someone point me to where in
>> the code this mapping takes place, as I'd like to do a text->uml2 data
>> type mapping myself.
>>
>> "->select(o : Operation | o.name = 'MyOp' and o.visibility =
>> VisibilityKind::public)"
>>
>> Thanks,
>> Andrew.
|
|
|
Powered by
FUDForum. Page generated in 0.03592 seconds