Checking for empty list of stereotypes [message #1710214] |
Mon, 05 October 2015 07:51  |
Eclipse User |
|
|
|
Hi,
I have some code to print the list of stereotypes with their attributes:
Applied Stereotypes:
[for (st:Stereotype | dt.getAppliedStereotypes())]<drop/>
• [st.name/]
[/for]<drop/>
with some additional code to display the stereotype attributes.
However, if the list of stereotypes is empty, I would still see the :Applied stereotypes: " text.
I have tried adding an if oclIsUndefined as explained in the tutorial, page 18:
[if (not (dt.getAppliedStereotypes().oclIsUndefined()))]<drop/>
Applied Stereotypes:
[for (st:Stereotype | dt.getAppliedStereotypes())]<drop/>
• [st.name/]
[/for]<drop/>
[/if]
but gendoc complains with the error:
Cannot find operation (not()) for the type (Bag(Boolean))
I have tried replacing oclIsUndefined by oclIsEmpty but then the error is
Cannot find operation (oclIsEmpty()) for the type (Stereotype)
What is the way to test if the list of stereotype is empty?
Thanks,
Marc
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05123 seconds