@Override
    protected void compile(ProtoModule module, Proto proto) throws IOException
    {
        String javaPackageName = proto.getJavaPackageName();
        String template = module.getOption("emulation_mode") == null ?
                "gwt_overlay" : "gwt_overlay_emulation_mode";
        StringTemplateGroup group = getSTG(template);

        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();
        }

        for (Message m : proto.getMessages())
        {
            Writer writer = CompilerUtil.newWriter(module,
                    javaPackageName, m.getName() + ".java");
            AutoIndentWriter out = new AutoIndentWriter(writer);

            StringTemplate messageBlock = group.getInstanceOf("message_block");
            messageBlock.setAttribute("message", m);
            messageBlock.setAttribute("module", module);
            messageBlock.setAttribute("options", module.getOptions());

            messageBlock.write(out);
            writer.close();
        }

    }
Compiles proto files to gwt overlays source (java) files.

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