Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
73e0d748
Unverified
Commit
73e0d748
authored
Jun 15, 2019
by
ST-DDT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to using enum based methods
parent
6ee16a9c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
210 additions
and
51 deletions
+210
-51
java_doc_comment.cc
src/google/protobuf/compiler/java/java_doc_comment.cc
+152
-17
java_doc_comment.h
src/google/protobuf/compiler/java/java_doc_comment.h
+28
-4
java_enum_field.cc
src/google/protobuf/compiler/java/java_enum_field.cc
+0
-0
java_enum_field_lite.cc
src/google/protobuf/compiler/java/java_enum_field_lite.cc
+0
-0
java_message_field.cc
src/google/protobuf/compiler/java/java_message_field.cc
+16
-16
java_message_field_lite.cc
src/google/protobuf/compiler/java/java_message_field_lite.cc
+2
-2
java_primitive_field.cc
src/google/protobuf/compiler/java/java_primitive_field.cc
+0
-0
java_primitive_field_lite.cc
...oogle/protobuf/compiler/java/java_primitive_field_lite.cc
+12
-12
java_string_field.cc
src/google/protobuf/compiler/java/java_string_field.cc
+0
-0
java_string_field_lite.cc
src/google/protobuf/compiler/java/java_string_field_lite.cc
+0
-0
No files found.
src/google/protobuf/compiler/java/java_doc_comment.cc
View file @
73e0d748
...
...
@@ -185,42 +185,177 @@ void WriteFieldDocComment(io::Printer* printer, const FieldDescriptor* field) {
printer
->
Print
(
" */
\n
"
);
}
void
WriteFieldGetterDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
)
{
void
WriteFieldAccessorDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
,
const
FieldAccessorType
type
,
const
bool
builder
)
{
printer
->
Print
(
"/**
\n
"
);
WriteDocCommentBody
(
printer
,
field
);
printer
->
Print
(
" * <code>$def$</code>
\n
"
,
"def"
,
EscapeJavadoc
(
FirstLineOf
(
field
->
DebugString
())));
printer
->
Print
(
" * @return The $name$.
\n
"
,
"name"
,
field
->
camelcase_name
());
switch
(
type
)
{
case
HAZZER
:
printer
->
Print
(
" * @return Whether the $name$ field is set.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
GETTER
:
printer
->
Print
(
" * @return The $name$.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
SETTER
:
printer
->
Print
(
" * @param value The $name$ to set.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
CLEARER
:
// Print nothing
break
;
// Repeated
case
LIST_COUNT
:
printer
->
Print
(
" * @return The number of $name$(s).
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_GETTER
:
printer
->
Print
(
" * @return A list containing the $name$(s).
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_INDEXED_GETTER
:
printer
->
Print
(
" * @param index The index of the element to return.
\n
"
);
printer
->
Print
(
" * @return The $name$(s) at the given index.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_INDEXED_SETTER
:
printer
->
Print
(
" * @param index The index to set the value at.
\n
"
);
printer
->
Print
(
" * @param value The $name$ to set.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_ADDER
:
printer
->
Print
(
" * @param value The $name$ to add.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_MULTI_ADDER
:
printer
->
Print
(
" * @param values The $name$(s) to add.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
}
if
(
builder
)
{
printer
->
Print
(
" * @return This builder for chaining.
\n
"
);
}
printer
->
Print
(
" */
\n
"
);
}
void
WriteFieldHaserDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
)
{
void
WriteFieldEnumValueAccessorDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
,
const
FieldAccessorType
type
,
const
bool
builder
)
{
printer
->
Print
(
"/**
\n
"
);
WriteDocCommentBody
(
printer
,
field
);
printer
->
Print
(
" * <code>$def$</code>
\n
"
,
"def"
,
printer
->
Print
(
" * <code>$def$</code>
\n
"
,
"def"
,
EscapeJavadoc
(
FirstLineOf
(
field
->
DebugString
())));
printer
->
Print
(
" * @return Whether the $name$ field is set.
\n
"
,
"name"
,
field
->
camelcase_name
());
switch
(
type
)
{
case
HAZZER
:
// Should never happen
break
;
case
GETTER
:
printer
->
Print
(
" * @return The enum value for $name$.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
SETTER
:
printer
->
Print
(
" * @param value The enum value for $name$ to set.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
CLEARER
:
// Print nothing
break
;
// Repeated
case
LIST_COUNT
:
// Should never happen
break
;
case
LIST_GETTER
:
printer
->
Print
(
" * @return A list containing the enum values for $name$(s).
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_INDEXED_GETTER
:
printer
->
Print
(
" * @param index The index of the value to return.
\n
"
);
printer
->
Print
(
" * @return The enum value of the $name$ at the given index.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_INDEXED_SETTER
:
printer
->
Print
(
" * @param index The index of the value to return.
\n
"
);
printer
->
Print
(
" * @param value The enum value of the $name$ to set.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_ADDER
:
printer
->
Print
(
" * @param value The enum value of the $name$ to add.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_MULTI_ADDER
:
printer
->
Print
(
" * @param values The enum values of the $name$(s) to add.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
}
if
(
builder
)
{
printer
->
Print
(
" * @return This builder for chaining.
\n
"
);
}
printer
->
Print
(
" */
\n
"
);
}
void
WriteFieldSetterDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
)
{
void
WriteFieldStringBytesAccessorDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
,
const
FieldAccessorType
type
,
const
bool
builder
)
{
printer
->
Print
(
"/**
\n
"
);
WriteDocCommentBody
(
printer
,
field
);
printer
->
Print
(
" * <code>$def$</code>
\n
"
,
"def"
,
printer
->
Print
(
" * <code>$def$</code>
\n
"
,
"def"
,
EscapeJavadoc
(
FirstLineOf
(
field
->
DebugString
())));
printer
->
Print
(
" * @param value The $name$ to set.
\n
"
,
"name"
,
field
->
camelcase_name
());
printer
->
Print
(
" * @return This builder for chaining.
\n
"
);
switch
(
type
)
{
case
HAZZER
:
// Should never happen
break
;
case
GETTER
:
printer
->
Print
(
" * @return The bytes for $name$.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
SETTER
:
printer
->
Print
(
" * @param value The bytes for $name$ to set.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
CLEARER
:
// Print nothing
break
;
// Repeated
case
LIST_COUNT
:
// Should never happen
break
;
case
LIST_GETTER
:
printer
->
Print
(
" * @return A list containing the bytes for $name$(s).
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_INDEXED_GETTER
:
printer
->
Print
(
" * @param index The index of the value to return.
\n
"
);
printer
->
Print
(
" * @return The bytes of the $name$ at the given index.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_INDEXED_SETTER
:
printer
->
Print
(
" * @param index The index of the value to return.
\n
"
);
printer
->
Print
(
" * @param value The bytes of the $name$ to set.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_ADDER
:
printer
->
Print
(
" * @param value The bytes of the $name$ to add.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
case
LIST_MULTI_ADDER
:
printer
->
Print
(
" * @param values The bytes of the $name$(s) to add.
\n
"
,
"name"
,
field
->
camelcase_name
());
break
;
}
if
(
builder
)
{
printer
->
Print
(
" * @return This builder for chaining.
\n
"
);
}
printer
->
Print
(
" */
\n
"
);
}
void
WriteFieldClearerDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
)
{
printer
->
Print
(
"/**
\n
"
);
WriteDocCommentBody
(
printer
,
field
);
printer
->
Print
(
" * <code>$def$</code>
\n
"
,
"def"
,
EscapeJavadoc
(
FirstLineOf
(
field
->
DebugString
())));
printer
->
Print
(
" * @return This builder for chaining.
\n
"
);
printer
->
Print
(
" */
\n
"
);
}
// Enum
void
WriteEnumDocComment
(
io
::
Printer
*
printer
,
const
EnumDescriptor
*
enum_
)
{
printer
->
Print
(
"/**
\n
"
);
...
...
src/google/protobuf/compiler/java/java_doc_comment.h
View file @
73e0d748
...
...
@@ -52,12 +52,36 @@ namespace protobuf {
namespace
compiler
{
namespace
java
{
enum
FieldAccessorType
{
HAZZER
,
GETTER
,
SETTER
,
CLEARER
,
// Repeated
LIST_COUNT
,
LIST_GETTER
,
LIST_INDEXED_GETTER
,
LIST_INDEXED_SETTER
,
LIST_ADDER
,
LIST_MULTI_ADDER
};
void
WriteMessageDocComment
(
io
::
Printer
*
printer
,
const
Descriptor
*
message
);
void
WriteFieldDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
);
void
WriteFieldGetterDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
);
void
WriteFieldHaserDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
);
void
WriteFieldSetterDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
);
void
WriteFieldClearerDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
);
void
WriteFieldAccessorDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
,
const
FieldAccessorType
type
,
const
bool
builder
=
false
);
void
WriteFieldEnumValueAccessorDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
,
const
FieldAccessorType
type
,
const
bool
builder
=
false
);
void
WriteFieldStringBytesAccessorDocComment
(
io
::
Printer
*
printer
,
const
FieldDescriptor
*
field
,
const
FieldAccessorType
type
,
const
bool
builder
=
false
);
void
WriteEnumDocComment
(
io
::
Printer
*
printer
,
const
EnumDescriptor
*
enum_
);
void
WriteEnumValueDocComment
(
io
::
Printer
*
printer
,
const
EnumValueDescriptor
*
value
);
...
...
src/google/protobuf/compiler/java/java_enum_field.cc
View file @
73e0d748
This diff is collapsed.
Click to expand it.
src/google/protobuf/compiler/java/java_enum_field_lite.cc
View file @
73e0d748
This diff is collapsed.
Click to expand it.
src/google/protobuf/compiler/java/java_message_field.cc
View file @
73e0d748
...
...
@@ -144,12 +144,12 @@ void ImmutableMessageFieldGenerator::GenerateInterfaceMembers(
// interface so that builders can choose dynamically to either return a
// message or a nested builder, so that asking for the interface doesn't
// cause a message to ever be built.
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"$deprecation$boolean has$capitalized_name$();
\n
"
);
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"$deprecation$$type$ get$capitalized_name$();
\n
"
);
WriteField
Getter
DocComment
(
printer
,
descriptor_
);
WriteFieldDocComment
(
printer
,
descriptor_
);
printer
->
Print
(
variables_
,
"$deprecation$$type$OrBuilder get$capitalized_name$OrBuilder();
\n
"
);
...
...
@@ -161,14 +161,14 @@ void ImmutableMessageFieldGenerator::GenerateMembers(
PrintExtraFieldInfo
(
variables_
,
printer
);
if
(
SupportFieldPresence
(
descriptor_
->
file
()))
{
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"$deprecation$public boolean ${$has$capitalized_name$$}$() {
\n
"
" return $get_has_field_bit_message$;
\n
"
"}
\n
"
);
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"$deprecation$public $type$ ${$get$capitalized_name$$}$() {
\n
"
...
...
@@ -185,14 +185,14 @@ void ImmutableMessageFieldGenerator::GenerateMembers(
"}
\n
"
);
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
}
else
{
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"$deprecation$public boolean ${$has$capitalized_name$$}$() {
\n
"
" return $name$_ != null;
\n
"
"}
\n
"
);
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"$deprecation$public $type$ ${$get$capitalized_name$$}$() {
\n
"
...
...
@@ -261,7 +261,7 @@ void ImmutableMessageFieldGenerator::GenerateBuilderMembers(
// field of type "Field" called "Field".
// boolean hasField()
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
if
(
support_field_presence
)
{
printer
->
Print
(
variables_
,
...
...
@@ -279,14 +279,14 @@ void ImmutableMessageFieldGenerator::GenerateBuilderMembers(
}
// Field getField()
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
PrintNestedBuilderFunction
(
printer
,
"$deprecation$public $type$ ${$get$capitalized_name$$}$()"
,
"return $name$_ == null ? $type$.getDefaultInstance() : $name$_;
\n
"
,
"return $name$Builder_.getMessage();
\n
"
,
NULL
);
// Field.Builder setField(Field value)
WriteField
Setter
DocComment
(
printer
,
descriptor_
);
WriteFieldDocComment
(
printer
,
descriptor_
);
PrintNestedBuilderFunction
(
printer
,
"$deprecation$public Builder ${$set$capitalized_name$$}$($type$ value)"
,
...
...
@@ -303,7 +303,7 @@ void ImmutableMessageFieldGenerator::GenerateBuilderMembers(
"return this;
\n
"
);
// Field.Builder setField(Field.Builder builderForValue)
WriteField
Setter
DocComment
(
printer
,
descriptor_
);
WriteFieldDocComment
(
printer
,
descriptor_
);
PrintNestedBuilderFunction
(
printer
,
"$deprecation$public Builder ${$set$capitalized_name$$}$(
\n
"
...
...
@@ -347,7 +347,7 @@ void ImmutableMessageFieldGenerator::GenerateBuilderMembers(
"return this;
\n
"
);
// Field.Builder clearField()
WriteField
Clearer
DocComment
(
printer
,
descriptor_
);
WriteFieldDocComment
(
printer
,
descriptor_
);
PrintNestedBuilderFunction
(
printer
,
"$deprecation$public Builder ${$clear$capitalized_name$$}$()"
,
...
...
@@ -535,13 +535,13 @@ ImmutableMessageOneofFieldGenerator::~ImmutableMessageOneofFieldGenerator() {}
void
ImmutableMessageOneofFieldGenerator
::
GenerateMembers
(
io
::
Printer
*
printer
)
const
{
PrintExtraFieldInfo
(
variables_
,
printer
);
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"$deprecation$public boolean ${$has$capitalized_name$$}$() {
\n
"
" return $has_oneof_case_message$;
\n
"
"}
\n
"
);
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"$deprecation$public $type$ ${$get$capitalized_name$$}$() {
\n
"
" if ($has_oneof_case_message$) {
\n
"
...
...
@@ -579,7 +579,7 @@ void ImmutableMessageOneofFieldGenerator::GenerateBuilderMembers(
// field of type "Field" called "Field".
// boolean hasField()
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"$deprecation$public boolean ${$has$capitalized_name$$}$() {
\n
"
" return $has_oneof_case_message$;
\n
"
...
...
@@ -587,7 +587,7 @@ void ImmutableMessageOneofFieldGenerator::GenerateBuilderMembers(
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
// Field getField()
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
PrintNestedBuilderFunction
(
printer
,
"$deprecation$public $type$ ${$get$capitalized_name$$}$()"
,
...
...
src/google/protobuf/compiler/java/java_message_field_lite.cc
View file @
73e0d748
...
...
@@ -121,9 +121,9 @@ int ImmutableMessageFieldLiteGenerator::GetNumBitsForMessage() const {
void
ImmutableMessageFieldLiteGenerator
::
GenerateInterfaceMembers
(
io
::
Printer
*
printer
)
const
{
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"$deprecation$boolean has$capitalized_name$();
\n
"
);
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"$deprecation$$type$ get$capitalized_name$();
\n
"
);
}
...
...
src/google/protobuf/compiler/java/java_primitive_field.cc
View file @
73e0d748
This diff is collapsed.
Click to expand it.
src/google/protobuf/compiler/java/java_primitive_field_lite.cc
View file @
73e0d748
...
...
@@ -198,11 +198,11 @@ int ImmutablePrimitiveFieldLiteGenerator::GetNumBitsForMessage() const {
void
ImmutablePrimitiveFieldLiteGenerator
::
GenerateInterfaceMembers
(
io
::
Printer
*
printer
)
const
{
if
(
SupportFieldPresence
(
descriptor_
->
file
()))
{
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"$deprecation$boolean has$capitalized_name$();
\n
"
);
}
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"$deprecation$$type$ get$capitalized_name$();
\n
"
);
}
...
...
@@ -218,7 +218,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
printer
->
Print
(
variables_
,
"private $field_type$ $name$_;
\n
"
);
PrintExtraFieldInfo
(
variables_
,
printer
);
if
(
SupportFieldPresence
(
descriptor_
->
file
()))
{
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"@java.lang.Override
\n
"
...
...
@@ -228,7 +228,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
}
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"@java.lang.Override
\n
"
"$deprecation$public $type$ ${$get$capitalized_name$$}$() {
\n
"
...
...
@@ -236,7 +236,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
"}
\n
"
);
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
WriteField
DocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
SETTER
);
printer
->
Print
(
variables_
,
"private void set$capitalized_name$($type$ value) {
\n
"
"$null_check$"
...
...
@@ -244,7 +244,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
" $name$_ = value;
\n
"
"}
\n
"
);
WriteField
DocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
CLEARER
);
printer
->
Print
(
variables_
,
"private void clear$capitalized_name$() {
\n
"
" $clear_has_field_bit_message$
\n
"
);
...
...
@@ -264,7 +264,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateMembers(
void
ImmutablePrimitiveFieldLiteGenerator
::
GenerateBuilderMembers
(
io
::
Printer
*
printer
)
const
{
if
(
SupportFieldPresence
(
descriptor_
->
file
()))
{
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"@java.lang.Override
\n
"
...
...
@@ -274,7 +274,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
}
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"@java.lang.Override
\n
"
"$deprecation$public $type$ ${$get$capitalized_name$$}$() {
\n
"
...
...
@@ -347,7 +347,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateMembers(
io
::
Printer
*
printer
)
const
{
PrintExtraFieldInfo
(
variables_
,
printer
);
if
(
SupportFieldPresence
(
descriptor_
->
file
()))
{
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"@java.lang.Override
\n
"
...
...
@@ -357,7 +357,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateMembers(
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
}
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"@java.lang.Override
\n
"
"$deprecation$public $type$ ${$get$capitalized_name$$}$() {
\n
"
...
...
@@ -397,7 +397,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateFieldInfo(
void
ImmutablePrimitiveOneofFieldLiteGenerator
::
GenerateBuilderMembers
(
io
::
Printer
*
printer
)
const
{
if
(
SupportFieldPresence
(
descriptor_
->
file
()))
{
WriteField
HaserDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
HAZZER
);
printer
->
Print
(
variables_
,
"@java.lang.Override
\n
"
...
...
@@ -407,7 +407,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers(
printer
->
Annotate
(
"{"
,
"}"
,
descriptor_
);
}
WriteField
GetterDocComment
(
printer
,
descriptor_
);
WriteField
AccessorDocComment
(
printer
,
descriptor_
,
GETTER
);
printer
->
Print
(
variables_
,
"@java.lang.Override
\n
"
"$deprecation$public $type$ ${$get$capitalized_name$$}$() {
\n
"
...
...
src/google/protobuf/compiler/java/java_string_field.cc
View file @
73e0d748
This diff is collapsed.
Click to expand it.
src/google/protobuf/compiler/java/java_string_field_lite.cc
View file @
73e0d748
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment