[protobuf] Re: Java - DynamicMessage and FileDescriptorProto

2011-07-28 Thread Giancarlo Frison
;A").findFieldByName("f"), >                         messageB.build() ); > > I hope I did not add any errors when abstracting the code and that I > understood your problem correctly. > > Kind regards, > Robert > > On 28 Jul.,

[protobuf] Re: Java - DynamicMessage and FileDescriptorProto

2011-07-28 Thread Giancarlo Frison
ge field is a complex > type, you should build that complex type first, and pass the built > FileDescriptor object to the buildFrom() in the dependencies array. > > On Wed, Jul 27, 2011 at 7:36 AM, Giancarlo Frison wrote: > > > > > > > > > if I call setTypeNam

[protobuf] Re: Java - DynamicMessage and FileDescriptorProto

2011-07-27 Thread Giancarlo Frison
sages. > You pass in the name of the message. > > Kind regards, > Robert > > On 27 Jul., 10:35, Giancarlo Frison wrote: > > > > > > > > > Thank you very much Pherl! > > > An another question. What about not-pri

[protobuf] Re: how to create descriptors dynamically with repeated and complex fields

2011-07-27 Thread Giancarlo Frison
Good! If I want to set a field type as Message, where I must define the inner type? thanks! On Jul 26, 8:32 pm, Pherl Liu wrote: > See my response in the other thread. You can set label to the > FieldDescriptorProto. > > On Tue, Jul 26, 2011 at 12:31 AM, Giancarlo

[protobuf] Re: Java - DynamicMessage and FileDescriptorProto

2011-07-27 Thread Giancarlo Frison
to: > > LABEL_OPTIONAL = 1; > > LABEL_REQUIRED      = 2;LABEL_REPEATED      = 3; > > On Tue, Jul 26, 2011 at 12:21 AM, Giancarlo Frison wrote: > > > > > > > > > There is this example that I'm approaching to re-implement > >http://flori.posterous.com/

[protobuf] Re: Java - DynamicMessage and FileDescriptorProto

2011-07-26 Thread Giancarlo Frison
There is this example that I'm approaching to re-implement http://flori.posterous.com/dynamically-creating-protocol-buffer-objects a question: How to handle repeated fields? How can you describe them in the fieldDescriptor? On Jul 18, 5:20 pm, yoave wrote: > Hi all, > > I've got 2 questions:

[protobuf] how to create descriptors dynamically with repeated and complex fields

2011-07-26 Thread Giancarlo Frison
Hi all, I'm attempting to create descriptors dynamically for generating custom message on the fly. The trouble is when I have to describe a field as 'repeated' and dynamically serialize and parse it. How define 'repeated' fields? This is how I create such descriptors (http://flori.posterous.com