Accessing EMF model EEnum isSetX() in template [message #31779] |
Tue, 28 August 2007 13:08  |
Eclipse User |
|
|
|
Hi,
Is it possible (aside from creating a custom jet tag or xpath function) to
access/call/retrieve the value of the ESet property or isSetX() method of
an EObject that has an EAttribute X of type EEnum? In my ecore, I already
have Unsettable to true, and I want to determine in the JET template
whether the attribute was set or unset.
Thanks,
Francis
|
|
|
|
Re: Accessing EMF model EEnum isSetX() in template [message #32060 is a reply to message #31990] |
Wed, 29 August 2007 13:09  |
Eclipse User |
|
|
|
Thanks Paul, this will save me a lot of time. I thought it was different
for enums, but I should have tried it first :-)
Paul Elder wrote:
> Francis:
> JET's XPath engine respects eIstSet(), and if this returns false, XPath
> expressions referencing attribute should behave as if the attribute is not
> there. So, the following should work to test if you attribute is set or
> not...
> <c:if test="$yourEObject/@yourEAttributeName" >
> ... done if yourEObject.getYourEAttributeName().eIsSet() is true ...
> </c:if>
> <c:if test="not( $yourEObject/@yourEAttributeName )" >
> ... done if yourEObject.getYourEAttributeName().eIsSet() is false ...
> </c:if>
> Paul
|
|
|
Powered by
FUDForum. Page generated in 0.03367 seconds