Code generation based on APT and Freemarker