在Xtend中,是否可以在循环中使用break或者检查以停止循环?
«FOR e:d.entitys»
«FOR a:e.attributes»
«IF a.eClass.name.contentEquals('Something')»
«e.name» "This output should be output one for each Entity e"
«ENDIF»
«ENDFOR»
«ENDFOR»
我的输出是:
Entity 1 "This output should be output one for each Entity e"
Entity 1 "This output should be output one for each Entity e"
Entity 1 "This output should be output one for each Entity e"
Entity 2 "This output should be output one for each Entity e"
Entity 4 "This output should be output one for each Entity e"
Entity 4 "This output should be output one for each Entity e"
但是我想要的是:
Entity 1 "This output should be output one for each Entity e"
Entity 2 "This output should be output one for each Entity e"
Entity 4 "This output should be output one for each Entity e"
如何实现我想要的输出?我听说可以调用另一个方法或类似的东西,但我不知道如何做到这一点,有人能为我展示一些解决此问题的代码吗? 谢谢 :)