Use getDescriptor() to get the descriptor, then iterate through
descriptor.fields().

Note that this will not cover extensions.

BTW, I believe m.toBuilder() is equivalent to
m.newBuilderForType().mergeFrom(m).

On Fri, Nov 20, 2009 at 8:25 AM, Thibaut <tbr...@gmail.com> wrote:

> Hi,
>
> I can't find a method how I can access all the fields of the message.
> There is a method .getAllFields(); on the Message and Builder objects,
> but this will only return the fields which are set.
>
> I need to get access to all the fields (also those not set!) of a
> Message m object, so I can update the unset fields through the
> corresponding builder object (Message.Builder b = m.newBuilderForType
> ().mergeFrom(m);).
> How can I do this?
>
> Thanks,
> Thibaut
>
> --
>
> 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<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=.
>
>
>

--

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=.


Reply via email to