protected void writeEnums(ProtoModule module, Proto proto, String javaPackageName, StringTemplateGroup group)
            throws IOException
    {
        for (EnumGroup eg : proto.getEnumGroups())
        {
            Writer writer = CompilerUtil.newWriter(module,
                    javaPackageName, eg.getName() + ".java");
            AutoIndentWriter out = new AutoIndentWriter(writer);

            StringTemplate enumBlock = group.getInstanceOf("enum_block");
            enumBlock.setAttribute("eg", eg);
            enumBlock.setAttribute("module", module);
            enumBlock.setAttribute("options", module.getOptions());

            enumBlock.write(out);
            writer.close();
        }
    }
Compiles proto files to protobuf java messages (pojos).

@author David Yu
@created Jan 4, 2010
protostuff-compiler/src/main/java/io/protostuff/compiler/ProtoToJavaBeanCompiler.java