Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有一个返回 Writable 对象的 SimpleTemplate 类。可以这样做吗,因为我看不到要返回什么样的对象。我试过这样的东西:
Writable getTemplate() { return 'something that's a writable' }
我将如何从另一种方法中读取变量?
您可以这样做以返回一些可写的字符串内容:
Writable getTemplate() { { it.println "Some content" }.asWritable() }