Thanks, that was the missing part, got it working with the desc file,
without the need for the MyMessage class.
on the way with the above code I got error:
java.lang.IllegalArgumentException: ExtensionRegistry.add() must be
provided a default instance when adding an embedded message extension.
at com.google.protobuf.ExtensionRegistry.add(ExtensionRegistry.java:
175)
Looked in the ExtensionRegistery.java and saw the if check for the
JavaType.MESSAGE.
so for now just added the if check like below:
for(FieldDescriptor extension : fileDescriptor.getExtensions()) {
if(extension.getJavaType() != FieldDescriptor.JavaType.MESSAGE)
{
extensionRegistry.add(extension);
}
}
What is the correct way to do it?
--
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.