summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/ClassDefinition.cpp
diff options
context:
space:
mode:
authorDaniel Norman <danielnorman@google.com>2020-08-31 12:05:49 -0700
committerBill Peckham <bpeckham@google.com>2020-09-09 10:21:03 -0700
commit8abdf0e95a5d15a310b6df69d33a4510a0b44b4a (patch)
treef0c990be5370711e157b2e9e5ae746cb1af915b9 /tools/aapt2/java/ClassDefinition.cpp
parent93e6c963c3228074d0e0dd5f3f8d057d9bd11e05 (diff)
parent6997558ebbaa0c3e5708246807239f11e70ad35d (diff)
Merge SP1A.200727.001
Change-Id: Ibb86a528ed692cde325705779c7fa57e4b4de682
Diffstat (limited to 'tools/aapt2/java/ClassDefinition.cpp')
-rw-r--r--tools/aapt2/java/ClassDefinition.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/aapt2/java/ClassDefinition.cpp b/tools/aapt2/java/ClassDefinition.cpp
index f5f5b05491bb..3163497f0da6 100644
--- a/tools/aapt2/java/ClassDefinition.cpp
+++ b/tools/aapt2/java/ClassDefinition.cpp
@@ -23,15 +23,15 @@ using ::android::StringPiece;
namespace aapt {
-void ClassMember::Print(bool /*final*/, Printer* printer) const {
- processor_.Print(printer);
+void ClassMember::Print(bool /*final*/, Printer* printer, bool strip_api_annotations) const {
+ processor_.Print(printer, strip_api_annotations);
}
void MethodDefinition::AppendStatement(const StringPiece& statement) {
statements_.push_back(statement.to_string());
}
-void MethodDefinition::Print(bool final, Printer* printer) const {
+void MethodDefinition::Print(bool final, Printer* printer, bool) const {
printer->Print(signature_).Println(" {");
printer->Indent();
for (const auto& statement : statements_) {
@@ -74,12 +74,12 @@ bool ClassDefinition::empty() const {
return true;
}
-void ClassDefinition::Print(bool final, Printer* printer) const {
+void ClassDefinition::Print(bool final, Printer* printer, bool strip_api_annotations) const {
if (empty() && !create_if_empty_) {
return;
}
- ClassMember::Print(final, printer);
+ ClassMember::Print(final, printer, strip_api_annotations);
printer->Print("public ");
if (qualifier_ == ClassQualifier::kStatic) {
@@ -93,7 +93,7 @@ void ClassDefinition::Print(bool final, Printer* printer) const {
// and takes precedence over a previous member with the same name. The overridden member is
// set to nullptr.
if (member != nullptr) {
- member->Print(final, printer);
+ member->Print(final, printer, strip_api_annotations);
printer->Println();
}
}
@@ -111,11 +111,11 @@ constexpr static const char* sWarningHeader =
" */\n\n";
void ClassDefinition::WriteJavaFile(const ClassDefinition* def, const StringPiece& package,
- bool final, io::OutputStream* out) {
+ bool final, bool strip_api_annotations, io::OutputStream* out) {
Printer printer(out);
printer.Print(sWarningHeader).Print("package ").Print(package).Println(";");
printer.Println();
- def->Print(final, &printer);
+ def->Print(final, &printer, strip_api_annotations);
}
} // namespace aapt