【发布时间】:2008-08-22 18:47:03
【问题描述】:
当使用 Groovy MarkupBuilder 时,我有一些地方需要将文本输出到文档中,或者调用将文本输出到文档中的函数。目前,我正在使用未定义的标签 "text" 来进行输出。有没有更好的方法来编写这段代码?
li {
text("${type.getAlias()} blah blah ")
function1(type.getXYZ())
if (type instanceof Class1) {
text(" implements ")
ft.getList().each {
if (it == '') return
text(it)
if (!function2(type, it)) text(", ")
}
}
}
【问题讨论】: