New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for setters and getters insertion points #2684
Comments
dopuskh3
pushed a commit
to criteo-forks/protobuf
that referenced
this issue
Feb 7, 2017
Add the following insertion points: - builder_setter_scope:<fullname>.setField - builder_setter_scope:<fullname>.clearField - builder_setter_scope:<fullname>.clearOneOf - builder_setter_scope:<fullname>.setRepeatedField - builder_setter_scope:<fullname>.addRepeatedField - setter_scope:<fullname>.set<capitalized_name>) - setter_scope:<fullname>.set<capitalized_name>Bytes) Github Issue: protocolbuffers#2684
dopuskh3
pushed a commit
to criteo-forks/protobuf
that referenced
this issue
Feb 13, 2017
Add the following insertion points: - field_modifier_scope_{before,after}:<fullname>.setField - field_modifier_scope_{before,after}:<fullname>.clearField - field_modifier_scope_{before,after}:<fullname>.clearOneOf - field_modifier_scope_{before,after}:<fullname>.setRepeatedField - field_modifier_scope_{before,after}:<fullname>.addRepeatedField - field_modifier_scope_{before,after}:<fullname>.set<capitalized_name>) - field_modifier_scope_{before,after}:<fullname>.set<capitalized_name>Bytes) - field_modifier_scope_{before,after}:<fullname>.add<capitalized_name>) - field_modifier_scope_{before,after}:<fullname>.addAll<capitalized_name>Bytes) Two entry points are provided for each at scope start and end. Github Issue: protocolbuffers#2684
dopuskh3
pushed a commit
to criteo-forks/protobuf
that referenced
this issue
Feb 17, 2017
Add the following insertion points: - field_modifier_scope_{before,after}:<fullname>.setField - field_modifier_scope_{before,after}:<fullname>.clearField - field_modifier_scope_{before,after}:<fullname>.clearOneOf - field_modifier_scope_{before,after}:<fullname>.setRepeatedField - field_modifier_scope_{before,after}:<fullname>.addRepeatedField - field_modifier_scope_{before,after}:<fullname>.set<capitalized_name>) - field_modifier_scope_{before,after}:<fullname>.set<capitalized_name>Bytes) - field_modifier_scope_{before,after}:<fullname>.add<capitalized_name>) - field_modifier_scope_{before,after}:<fullname>.addAll<capitalized_name>Bytes) Two entry points are provided for each at scope start and end. Github Issue: protocolbuffers#2684
dopuskh3
pushed a commit
to criteo-forks/protobuf
that referenced
this issue
Feb 17, 2017
Add the following insertion points: - field_modifier_scope_{before,after}:<fullname>.setField - field_modifier_scope_{before,after}:<fullname>.clearField - field_modifier_scope_{before,after}:<fullname>.clearOneOf - field_modifier_scope_{before,after}:<fullname>.setRepeatedField - field_modifier_scope_{before,after}:<fullname>.addRepeatedField - field_modifier_scope_{before,after}:<fullname>.set<capitalized_name>) - field_modifier_scope_{before,after}:<fullname>.set<capitalized_name>Bytes) - field_modifier_scope_{before,after}:<fullname>.add<capitalized_name>) - field_modifier_scope_{before,after}:<fullname>.addAll<capitalized_name>Bytes) Two entry points are provided for each at scope start and end. Github Issue: protocolbuffers#2684
gturri
pushed a commit
to criteo-forks/protobuf
that referenced
this issue
Jun 29, 2017
Add the following insertion points: * builder_field_modifier_scope_after:<type_name>.add<field_name> * builder_field_modifier_scope_after:<type_name>.addAll<field_name> * builder_field_modifier_scope_after:<type_name>.addBuilder<field_name> * builder_field_modifier_scope_after:<type_name>.addIndex<field_name> * builder_field_modifier_scope_after:<type_name>.clear<field_name> * builder_field_modifier_scope_after:<type_name>.remove<field_name> * builder_field_modifier_scope_after:<type_name>.put<field_name> * builder_field_modifier_scope_after:<type_name>.putAll<field_name> * builder_field_modifier_scope_after:<type_name>.set<field_name> * builder_field_modifier_scope_after:<type_name>.setField * builder_field_modifier_scope_after:<type_name>.clearOneOf * builder_field_modifier_scope_after:<type_name>.setRepeatedField * builder_field_modifier_scope_after:<type_name>.addRepeatedField With those insertion points, we're able to implement a plugin that does what is described on protocolbuffers#2684. ie: with those patches, we're able to make a distinction between a field which has a default value and a field which isn't set. Said differently, this is how we solve protocolbuffers#1606 for Java
gturri
pushed a commit
to criteo-forks/protobuf
that referenced
this issue
Jun 29, 2017
With those insertion points, we're able to implement a plugin that does what is described on protocolbuffers#2684. ie: with those patches, we're able to make a distinction between a field which has a default value and a field which isn't set. Said differently, this is how we solve protocolbuffers#1606 for C#
gturri
pushed a commit
to criteo-forks/protobuf
that referenced
this issue
Jun 30, 2017
With those insertion points, we're able to implement a plugin that does what is described on protocolbuffers#2684. ie: with those patches, we're able to make a distinction between a field which has a default value and a field which isn't set. Said differently, this is how we solve protocolbuffers#1606 for C#
This was referenced Jun 30, 2017
ychuzevi
pushed a commit
to criteo-forks/protobuf
that referenced
this issue
Sep 27, 2017
Add the following insertion points: * builder_field_add:<descriptor full name> * builder_field_addAll:<descriptor full name> * builder_field_addBuilder:<descriptor full name> * builder_field_addBuilderIndex:<descriptor full name> * builder_field_addBytes:<descriptor full name> * builder_field_addIndex:<descriptor full name> * builder_field_clear:<descriptor full name> * builder_field_put:<descriptor full name> * builder_field_putAll:<descriptor full name> * builder_field_remove:<descriptor full name> * builder_field_removeIndex:<descriptor full name> * builder_field_set:<descriptor full name> * builder_field_setBuilderIndex:<descriptor full name> * builder_field_setBytes:<descriptor full name> * builder_field_setIndex:<descriptor full name> * builder_field_setValue:<descriptor full name> With those insertion points, we're able to implement a plugin that does what is described on protocolbuffers#2684. ie: with those patches, we're able to make a distinction between a field which has a default value and a field which isn't set. Said differently, this is how we solve protocolbuffers#1606 for Java
@dopuskh3 What is the status of this plugin? Will it be available for all proto3 supported languages? |
Note that we are beginning to limit and reduce the number of insertion points. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adding insertion points in various field modifier could help extending generated classes with additional logic in those.
I think about implementing nullable support by using these insertion points the following way:
I will create a protobuf plugin that does the following:
Sounds like a less intrusive approach to solve issue #1606 but still requires additional insertion points.
The text was updated successfully, but these errors were encountered: