I'm assuming you're aware of the previous discussions about adding interfaces to generated protobuf code...so if you still really want to do this:
You would need to change the parser to accept this: http://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/compiler/parser.cc That means including it in the descriptor.proto definitions, which captures all definitions specified in a .proto file, and then plumbing it all the way through the Descriptor classes. An alternative would be to add an insertion point in the Java code generator. This file defines generated message classes: http://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/compiler/java/java_message.cc You can search for @@protoc_insertion_point to see how other insertion points are defined. This would then allow you to write a proto compiler plugin that reads a custom MessageOption with the interfaces you want to implement, and insert those interfaces. There are other insertion points available for you to actually add the methods to implement those interfaces. On Fri, Aug 17, 2012 at 5:39 AM, Kiamur <[email protected]> wrote: > Hi, > > I was searching the protoc source code to add the feature of generating > java code with an "implements" statement. Unfortunately, I don't know > exactly, where I have to add my addition. > > It should work like the "package" definition in the *.proto file. > > Can anybody point me to the appropriate source code locations or (even > better) can provide me with source file that contain this addition? i can > compile to protoc.exe myself. I'm just not abel to implement this feature > myself. > > Any help is much appreciated. > > Maik > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/protobuf/-/TXIlp_1ThYIJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
