diff options
author | Jeff Davidson <jpd@google.com> | 2015-04-06 16:29:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-06 16:29:20 +0000 |
commit | ff882b4094995bc7dd9b183951cf84aa04527361 (patch) | |
tree | f8b252def86c4bd71be3454b2542f72b9cd2a416 /src/google | |
parent | 00c7607ce445af504021447068d6237ba8100716 (diff) | |
parent | bae6b59812ac972c9792605d521d6ada069288b2 (diff) | |
download | external_protobuf-gradle_1.2.0.zip external_protobuf-gradle_1.2.0.tar.gz external_protobuf-gradle_1.2.0.tar.bz2 |
Merge "Generate a CREATOR for each Parcelable message."gradle_1.2.1gradle_1.2.0-rc1gradle_1.2.0android-wear-5.1.1_r1android-wear-5.1.0_r1
Diffstat (limited to 'src/google')
-rw-r--r-- | src/google/protobuf/compiler/javanano/javanano_message.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_message.cc b/src/google/protobuf/compiler/javanano/javanano_message.cc index 4026031..758c9e8 100644 --- a/src/google/protobuf/compiler/javanano/javanano_message.cc +++ b/src/google/protobuf/compiler/javanano/javanano_message.cc @@ -154,6 +154,17 @@ void MessageGenerator::Generate(io::Printer* printer) { } printer->Indent(); + if (params_.parcelable_messages()) { + printer->Print( + "\n" + "// Used by Parcelable\n" + "@SuppressWarnings({\"unused\"})\n" + "public static final android.os.Parcelable.Creator<$classname$> CREATOR =\n" + " new com.google.protobuf.nano.android.ParcelableMessageNanoCreator<\n" + " $classname$>($classname$.class);\n", + "classname", descriptor_->name()); + } + // Nested types and extensions for (int i = 0; i < descriptor_->extension_count(); i++) { ExtensionGenerator(descriptor_->extension(i), params_).Generate(printer); |