See my response in the other thread. You can set label to the FieldDescriptorProto.
On Tue, Jul 26, 2011 at 12:31 AM, Giancarlo Frison <[email protected]>wrote: > 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/ > dynamically-creating-protocol-buffer-objects): > > desBuilder = DescriptorProtos.DescriptorProto.newBuilder(); > > DescriptorProtos.FieldDescriptorProto.Builder fd1Builder = > DescriptorProtos.FieldDescriptorProto.newBuilder() > .setName(fieldName).setNumber(i++).setType(type); > > desBuilder.addField(fd1Builder.build()); > > thanks, > > -- > 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. > > -- 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.
