字符串模板中的分隔符
我在 stringtemplate 文件中有以下代码:
(1) Module $component$ = new Module(new GeometryDescription[] {$shapes;separator=", "$});
我知道这是错误的,因为我希望能够生成多个此行,
以便当我调用组件列表 Component1(North,part1,part2) 组件 2(北、部分 1、部分 2、部分 3) 我得到以下信息:
Module North = new Module(new GeometryDescription[] {part1,part2});
Module South = new Module(new GeometryDescription[] {part1,part2,part3});
我怎样才能写句子(1)才能做到这一点 谢谢
I have the following code in a stringtemplate file:
(1) Module $component$ = new Module(new GeometryDescription[] {$shapes;separator=", "$});
which i know is wrong as what I would like is to be able to generate multiple of this line
so that when i call a list of components Component1(North, part1, part2)
Component2(North, part1, part2,part3)
i get the following:
Module North = new Module(new GeometryDescription[] {part1,part2});
Module South = new Module(new GeometryDescription[] {part1,part2,part3});
how can i write sentence (1) to be able to do that
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将 (1) 包装在模板中,然后将该模板映射到组件列表中。
You need to wrap (1) in a template and then map that template across your list of components.