I'm looking for Java implementation of Protocol Buffer using annotation the same way it is implemented in protobuf-net project. I just want the easy of use of annotation without the need to constantly compile the .proto file using protoc.
- 2Hmmm... If only I knew java as well as I know .net :pMarc Gravell– Marc Gravell2011-10-08 15:05:30 +00:00Commented Oct 8, 2011 at 15:05
- Do you mean looking at the code of protobuf-net and translate it to Java?Ido Ran– Ido Ran2011-10-09 21:46:31 +00:00Commented Oct 9, 2011 at 21:46
- 2I mean I'm the author of protobuf-net, and it would be an interesting challenge to port it; unfortunately my java knowledge is fairly minimal.Marc Gravell– Marc Gravell2011-10-10 09:54:51 +00:00Commented Oct 10, 2011 at 9:54
Add a comment |
2 Answers
The Protostuff library can serialize annotated POJOs: https://protostuff.github.io/docs/protostuff-runtime/
1 Comment
Ido Ran
Thanks, that looks good. I'll try to use it inside Jersey container
Aside from great Protostuff library that is already mentioned, perhaps you might also consider trying out JSON instead -- unless you absolutely must use protobuf due to compatibility reasons. JSON processing on Java is not only very convenient (annotation-based, auto-detection), it is also competitive in performance (see jvm-serializers results, for example).