我有这项农艺方案,它使用一个提纲,制作一个农业组合文件。 一旦立案,就用下列文字写成:
myFile.withWriter {writer -> myConfigObject.writeTo(writer)}
结果是,根据单一行文撰写了结晶。 例如,地图将印成:
graphs=[["type":"std", "host":"localhost", "name":"cpurawlinux"], ["type":"std", "host":"localhost", "name":"memory"], ["type":"std", "host":"localhost", "name":"udp"] ... ]
which is quite unreadable if someone has to take a look at it. Is there a way to get a more friendly output? Something like that would be great:
graphs=[
["type":"std", "host":"localhost", "name":"cpurawlinux"],
["type":"std", "host":"localhost", "name":"memory"],
["type":"std", "host":"localhost", "name":"udp"]
...
]
我知道我可以创建自己的<条码>writeTo,但是在格罗维瓦里,没有哪儿?