我使用java代码中的Groovy模板:
import groovy.text.SimpleTemplateEngine
String template = 'Hello, $firstname <%print lastname%>!';
Map vars = new HashMap<String, String>();
vars.put("firstname", "John");
vars.put("lastname", "Doe");
SimpleTemplateEngine engine = new SimpleTemplateEngine();
Writable w = engine.createTemplate(template).make(vars);
System.out.println(w.toString());
如何从此模板中获取所有属性名称的列表,例如: