You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The task of mapping a proto type to Java class was initially based on .properties files, which mapped a proto type name to a Java class name.
Then, we improved the generation, migrating to using descriptor set files, and building KnownTypes basing on them. It works better on the code generation side, but in order to unpack just one message from Any we need to load and build a very big thing.
We can probably do better, generating a Java class file which would have ImmutableMap from one string with a proto type name to another string to a Java class name. The name of the class would be a constant, which KnownTypes would use to load the class, and use its mapping for loading the classes.
There are may be other, better options. This issue was raised in the discussion of our Protobuf article for DOU (см. секцию «Собрание типов»).
The text was updated successfully, but these errors were encountered:
The task of mapping a proto type to Java class was initially based on
.properties
files, which mapped a proto type name to a Java class name.Then, we improved the generation, migrating to using descriptor set files, and building
KnownTypes
basing on them. It works better on the code generation side, but in order to unpack just one message fromAny
we need to load and build a very big thing.We can probably do better, generating a Java class file which would have
ImmutableMap
from one string with a proto type name to another string to a Java class name. The name of the class would be a constant, which KnownTypes would use to load the class, and use its mapping for loading the classes.There are may be other, better options. This issue was raised in the discussion of our Protobuf article for DOU (см. секцию «Собрание типов»).
The text was updated successfully, but these errors were encountered: