Expressions in Raw Text [message #3630] |
Wed, 07 February 2007 06:12  |
Eclipse User |
|
|
|
OCLExpression<EClassifier> expr = parseDef(
"package ocltest context Fruit " + //$NON-NLS-1$
"def: bestColor(c : Color) : Color = if self.color = Color::black
then c else self.color endif" + //$NON-NLS-1$
" endpackage"); //$NON-NLS-1$
Constraint constraint = (Constraint) expr.eContainer().eContainer();
assertNotNull(constraint);
assertEquals(UMLReflection.DEFINITION, constraint.getStereotype());
assertSame(color, expr.getType());
I found this in the tests of ocl ecore.
My question, how can I evaluate expressions against this method.
The other methods define the operation via helper.defineOperation, but
how can I make this operation available for the evaluator.
Chris
|
|
|
Re: Expressions in Raw Text [message #3696 is a reply to message #3630] |
Wed, 07 February 2007 10:07  |
Eclipse User |
|
|
|
ok found it myself parsedef defines it in ocl
Chris
Chris Lenz schrieb:
> OCLExpression<EClassifier> expr = parseDef(
> "package ocltest context Fruit " + //$NON-NLS-1$
> "def: bestColor(c : Color) : Color = if self.color = Color::black
> then c else self.color endif" + //$NON-NLS-1$
> " endpackage"); //$NON-NLS-1$
>
> Constraint constraint = (Constraint) expr.eContainer().eContainer();
> assertNotNull(constraint);
>
> assertEquals(UMLReflection.DEFINITION, constraint.getStereotype());
>
> assertSame(color, expr.getType());
>
>
> I found this in the tests of ocl ecore.
>
> My question, how can I evaluate expressions against this method.
> The other methods define the operation via helper.defineOperation, but
> how can I make this operation available for the evaluator.
>
> Chris
|
|
|
Powered by
FUDForum. Page generated in 0.15050 seconds