[protobuf] Extensions in Java

2010-07-27 Thread Wouter
Hello,

I am basically following the approach described under Union Types in
the techniques section of the documentation. I am using extensions. I
have found that when deserialising protobuffers in Java it does not
automatically deserialise the extensions. I have to manually create a
registry (I am using protobuf-lite), register all my extensions, and
then pass that registry when deserialising a protobuffer.

Is this the right and only way of handling extensions in Java or am I
missing something? It seems that in C++ the extensions are recognised
automatically? I did not implement the c++ side of our application so
I am not sure about that.

Kind regards,
Wouter

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Extensions in Java

2010-07-27 Thread Jason Hsueh
The C++ implementation does have a singleton registry, which allows it to
magically parse extensions that are linked into the binary. This behavior
can be somewhat confusing though since it relies on what the linker decides
to do with generated code. The Java implementation uses an object oriented
approach - creating the registry and passing it in when parsing is the
correct way to work with extensions.

On Tue, Jul 27, 2010 at 1:03 AM, Wouter wouterlamm...@gmail.com wrote:

 Hello,

 I am basically following the approach described under Union Types in
 the techniques section of the documentation. I am using extensions. I
 have found that when deserialising protobuffers in Java it does not
 automatically deserialise the extensions. I have to manually create a
 registry (I am using protobuf-lite), register all my extensions, and
 then pass that registry when deserialising a protobuffer.

 Is this the right and only way of handling extensions in Java or am I
 missing something? It seems that in C++ the extensions are recognised
 automatically? I did not implement the c++ side of our application so
 I am not sure about that.

 Kind regards,
 Wouter

 --
 You received this message because you are subscribed to the Google Groups
 Protocol Buffers group.
 To post to this group, send email to proto...@googlegroups.com.
 To unsubscribe from this group, send email to
 protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 .
 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 proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.