class StCompiler extends AbstractProtoCompiler {

    protected void compile(String templateName, String templateArgName, Object templateArgValue, Writer writer) {
        ST st = stGroup.getInstanceOf(templateName);
        if (st == null) {
            throw new GeneratorException("Template %s is not defined", templateName);
        }
        st.add(templateArgName, templateArgValue);
        String result = st.render();
        try {
            writer.append(result);
        } catch (IOException e) {
            throw new GeneratorException("Could not write file: %s", e.getMessage(), e);
        }
    }

    @Inject public  StCompiler(OutputStreamFactory outputStreamFactory,
                      @Assisted String templateFileName);

}