4
В Xtend, возможно ли разбить цикл или проверить, чтобы прекратить цикл?Перерыв в петле Xtend
«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"
Как можно реализовать мой желаемый результат? Я слышал, что вы можете вызвать другой метод или что-то подобное, но я не знаю, как это сделать, может ли кто-нибудь показать мне какой-то код для этой проблемы? Спасибо :)