You can use message.getDescriptor().findFieldByNumber() to get the FieldDescriptor. Then use the reflection interface: Builder#setField() Take a look at http://code.google.com/p/protobuf/source/browse/trunk/java/src/main/java/com/google/protobuf/Message.java
On Fri, Jul 8, 2011 at 11:56 PM, SM <[email protected]> wrote: > Hi, > > I'm using java I found the corresponding methods in java. Thanks for > the quick response. > > > On Jul 8, 3:08 am, Pherl Liu <[email protected]> wrote: > > Which language are you using? In c++, you can call > > message::GetDescriptor()->FindFieldByNumber() to get a FieldDescriptor; > then > > call GetReflection()->Set* functions. > > > > > > > > On Fri, Jul 8, 2011 at 3:58 AM, SM <[email protected]> wrote: > > > Hello, > > > > > Is there a way to set the field value by the tag which we mention in > > > the proto file? > > > > > 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.- Hide quoted text - > > > > - Show quoted text - > -- > Sumanth > > -- > 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.
