title: A Java/Groovy API to generate Groovy source files
body: <p>I'm looking for a Java or Groovy library to generate Groovy classes source files.
  I've <a href="https://codemodel.dev.java.net/" rel="nofollow noreferrer">CodeModel</a> and this <a href="https://stackoverflow.com/questions/121324/a-java-api-to-generate-java-source-files">post</a> but they are for Java.</p>
  
  <p>Basically, I'd like to generate a Groovy class programmatically knowing the class name, the class attributes and generate particular methods depending on the class attributes.</p>
  
  <p>I know Groovy templates, but there might be other ways.</p>
  
  <p>Thanks</p>