如何将Xtend代码转换为Xtend模板
我有一个用Xtend编写的代码,在那里我不使用模板,但我只是在打印出来。但是,我了解到Xtend最有力的事情是它是基于模板的。因此,现在我想在Xtend中写下它。有什么简单的方法(并不是真的认为有一个,但是代码很长,所以我想尝试一下)。 其次,如果我有以下内容:
def method(){
method1()
method2()
method3()
...
}
在Xtend中,我应该写作
def method(){
'''
«method1()»
«method2()»
«method3()»
...
'''
}
,或者也可以写作,
def method(){
'''
«method1()
method2()
method3()»
...
'''
}
以便在不必实际打印任何东西时只使用一次终端。 欢迎将促进根据Xtend模板转换代码的任何其他提示。
谢谢!
I have a code written in Xtend, where I am not using templates but I am just printing things out. However, I learned that one the most powerful things about Xtend is that it is template based. Therefore, now I want to write it in Xtend. Is there any simple way to do it (don't really think there is one but the code is quite long so thought I would give it a try asking).
Second, if I have the following:
def method(){
method1()
method2()
method3()
...
}
In Xtend should I write
def method(){
'''
«method1()»
«method2()»
«method3()»
...
'''
}
Or can I also write
def method(){
'''
«method1()
method2()
method3()»
...
'''
}
So to use the terminal only once if I don't have to actually print anything.
Any other tips that would facilitate converting the code according to the Xtend templates are welcomed.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论