private Configuration newFreeMarkerConfig() {
        Configuration freeMarkerConfig = new Configuration(Configuration.VERSION_2_3_24);
        freeMarkerConfig.setDefaultEncoding("UTF-8");
        freeMarkerConfig.setClassForTemplateLoading(this.getClass(), "/");
        freeMarkerConfig
                .setTemplateExceptionHandler(TemplateExceptionHandler.DEBUG_HANDLER);

        return freeMarkerConfig;
    }
Util class that sets up the freemarker configuration and loads the templates.
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Freemarker.java