|[Acceleo] Error Getting Attributes with Specific Stereotypes [message #1232597]
||Fri, 17 January 2014 09:53
| Maya Retno
Registered: January 2014
Supposed I have a class Account in UML Class Diagram with 4 attributes: Integer fee, <<aParam>> Integer amount, <<aParam>> Integer balance, Integer id.
I would like to get the class name and its attributes with stereotypes <<aParam>>.
Here is my Acceleo transformation code:
class [aClass.name/] ([for (att: Property | aClass.getAllAttributes()) separator (',')]
[for (s: Stereotype | att.getAppliedStereotypes()) ? (s.name='aParam')]
[att.type.name/] [att.name/] [/for][/for]);
I hope the output is:
class Account (Integer amount, Integer balance);
but the current output is:
class Account (,,Integer amount,,Integer balance);
Based on the current output, at first it seems that all attributes was retrieved. Then when there is a condition that only attributes with stereotypes 'aParam' that should be retrieved, the attributes without stereotypes 'aParam' is deleted. Therefore, there is still space in the output with empty string (indicated by the comma separator).
Any idea how to solve this problem?
Powered by FUDForum
. Page generated in 0.01985 seconds