I'm constructing DynamicMessage in java from .proto file I loaded during runtime.
My problem is setting extension to such message.
I have:
Descriptors.Descriptorof the containing type andDynamicMessagecreated for itDescriptors.Descriptorof the extension type andDynamicMessagecreated for it
Now I don't know how to set the extension to the containing message.
The containing descriptor, if I ask for field list, lists only the fields without the fields in the extension. Which makes sense.
The extension descriptor has only the fields from the extending type (it doesn't have the fields from containing type).
Please advice how I can combine these together.
To get to the context you might want to have a look on my previous question on this topic which didn't care about extensions: Protocol buffer objects generated at runtime
EDIT:
In fact I'm looking for analogy of .setExtension of the generated message. I noticed that only GeneratedMessage extends ExtendableMessage but I believe there must be a way :)