diff options
author | Max Cai <maxtroy@google.com> | 2013-09-20 18:29:40 +0100 |
---|---|---|
committer | Max Cai <maxtroy@google.com> | 2013-09-23 15:27:13 +0100 |
commit | e74fe623e115237968a3de1143d7cdb4df710858 (patch) | |
tree | c4413272f7a158a97d3a88915d544aa57ee51578 /java/pom.xml | |
parent | 47dee56155c7bdb9855e51ff08c99db306d11a2d (diff) | |
download | external_protobuf-e74fe623e115237968a3de1143d7cdb4df710858.zip external_protobuf-e74fe623e115237968a3de1143d7cdb4df710858.tar.gz external_protobuf-e74fe623e115237968a3de1143d7cdb4df710858.tar.bz2 |
Accessor style for optional fields.
This CL implements the 'optional_field_style=accessors' option.
All optional fields will now be 1 Java field and 1 bit in a shared
bitfield behind get/set/has/clear accessor methods. The setter
performs null check for reference types (Strings and byte[]s).
Also decentralized the clear code generation.
Change-Id: I60ac78329e352e76c2f8139fba1f292383080ad3
Diffstat (limited to 'java/pom.xml')
-rw-r--r-- | java/pom.xml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/java/pom.xml b/java/pom.xml index bf5f666..f36d65f 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -157,6 +157,12 @@ <arg value="--proto_path=src/test/java" /> <arg value="../src/google/protobuf/unittest_has_nano.proto" /> </exec> + <exec executable="../src/protoc"> + <arg value="--javanano_out=optional_field_style=accessors:target/generated-test-sources" /> + <arg value="--proto_path=../src" /> + <arg value="--proto_path=src/test/java" /> + <arg value="../src/google/protobuf/unittest_accessors_nano.proto" /> + </exec> </tasks> <testSourceRoot>target/generated-test-sources</testSourceRoot> <!--testSourceRoot>target/generated-test-sources/opt-space</testSourceRoot--> |