I'm looking for Java implementation of Protocol Buffer using annotati开发者_开发技巧on 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.
The Protostuff library can serialize annotated POJOs: https://protostuff.github.io/docs/protostuff-runtime/
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).
精彩评论