protobuf/src/google/protobuf/compiler/java/java_helpers.h
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 // * Redistributions in binary form must reproduce the above
12 // copyright notice, this list of conditions and the following disclaimer
13 // in the documentation and/or other materials provided with the
14 // distribution.
15 // * Neither the name of Google Inc. nor the names of its
16 // contributors may be used to endorse or promote products derived from
17 // this software without specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 // Author: kenton@google.com (Kenton Varda)
32 // Based on original Protocol Buffers design by
33 // Sanjay Ghemawat, Jeff Dean, and others.
34 
35 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__
36 #define GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__
37 
38 #include <cstdint>
39 #include <string>
40 
41 #include <google/protobuf/compiler/java/java_context.h>
42 #include <google/protobuf/descriptor.pb.h>
43 #include <google/protobuf/io/printer.h>
44 #include <google/protobuf/descriptor.h>
45 
46 namespace google {
47 namespace protobuf {
48 namespace compiler {
49 namespace java {
50 
51 // Commonly-used separator comments. Thick is a line of '=', thin is a line
52 // of '-'.
53 extern const char kThickSeparator[];
54 extern const char kThinSeparator[];
55 
56 bool IsForbiddenKotlin(const std::string& field_name);
57 
58 // If annotation_file is non-empty, prints a javax.annotation.Generated
59 // annotation to the given Printer. annotation_file will be referenced in the
60 // annotation's comments field. delimiter should be the Printer's delimiter
61 // character. annotation_file will be included verbatim into a Java literal
62 // string, so it should not contain quotes or invalid Java escape sequences;
63 // however, these are unlikely to appear in practice, as the value of
64 // annotation_file should be generated from the filename of the source file
65 // being annotated (which in turn must be a Java identifier plus ".java").
66 void PrintGeneratedAnnotation(io::Printer* printer, char delimiter = '$',
67  const std::string& annotation_file = "");
68 
69 // If a GeneratedMessageLite contains non-lite enums, then its verifier
70 // must be instantiated inline, rather than retrieved from the enum class.
73  const std::map<std::string, std::string>& variables,
74  const char* var_name,
75  const char* terminating_string, bool enforce_lite);
76 
77 // Converts a name to camel-case. If cap_first_letter is true, capitalize the
78 // first letter.
79 std::string ToCamelCase(const std::string& input, bool lower_first);
80 
81 char ToUpperCh(char ch);
82 char ToLowerCh(char ch);
83 
84 // Converts a name to camel-case. If cap_first_letter is true, capitalize the
85 // first letter.
87  bool cap_first_letter);
88 // Converts the field's name to camel-case, e.g. "foo_bar_baz" becomes
89 // "fooBarBaz" or "FooBarBaz", respectively.
92 
93 // Similar, but for method names. (Typically, this merely has the effect
94 // of lower-casing the first letter of the name.)
96 
97 // Same as UnderscoresToCamelCase, but checks for reserved keywords
99 
100 // Similar to UnderscoresToCamelCase, but guarantees that the result is a
101 // complete Java identifier by adding a _ if needed.
103 
104 // Get an identifier that uniquely identifies this type within the file.
105 // This is used to declare static variables related to this type at the
106 // outermost file scope.
108 
109 // Gets the unqualified class name for the file. For each .proto file, there
110 // will be one Java class containing all the immutable messages and another
111 // Java class containing all the mutable messages.
112 // TODO(xiaofeng): remove the default value after updating client code.
113 std::string FileClassName(const FileDescriptor* file, bool immutable = true);
114 
115 // Returns the file's Java package name.
116 std::string FileJavaPackage(const FileDescriptor* file, bool immutable);
117 
118 // Returns output directory for the given package name.
120 
121 // Comma-separate list of option-specified interfaces implemented by the
122 // Message, to follow the "implements" declaration of the Message definition.
124 // Comma-separate list of option-specified interfaces implemented by the
125 // MutableMessage, to follow the "implements" declaration of the MutableMessage
126 // definition.
128 // Comma-separate list of option-specified interfaces implemented by the
129 // Builder, to follow the "implements" declaration of the Builder definition.
131 // Comma-separate list of option-specified interfaces extended by the
132 // MessageOrBuilder, to follow the "extends" declaration of the
133 // MessageOrBuilder definition.
135 
136 // Get the unqualified Java class name for mutable messages. i.e. without
137 // package or outer classnames.
139  return descriptor->name();
140 }
141 
142 // Whether the given descriptor is for one of the core descriptor protos. We
143 // cannot currently use the new runtime with core protos since there is a
144 // bootstrapping problem with obtaining their descriptors.
145 inline bool IsDescriptorProto(const Descriptor* descriptor) {
146  return descriptor->file()->name() == "net/proto2/proto/descriptor.proto" ||
147  descriptor->file()->name() == "google/protobuf/descriptor.proto";
148 }
149 
150 // Returns the stored type string used by the experimental runtime for oneof
151 // fields.
153 
154 
155 // Whether we should generate multiple java files for messages.
156 inline bool MultipleJavaFiles(const FileDescriptor* descriptor,
157  bool immutable) {
158  (void)immutable;
159  return descriptor->options().java_multiple_files();
160 }
161 
162 
163 // Returns true if `descriptor` will be written to its own .java file.
164 // `immutable` should be set to true if we're generating for the immutable API.
165 template <typename Descriptor>
166 bool IsOwnFile(const Descriptor* descriptor, bool immutable) {
167  return descriptor->containing_type() == NULL &&
168  MultipleJavaFiles(descriptor->file(), immutable);
169 }
170 
171 template <>
172 inline bool IsOwnFile(const ServiceDescriptor* descriptor, bool immutable) {
173  return MultipleJavaFiles(descriptor->file(), immutable);
174 }
175 
176 // If `descriptor` describes an object with its own .java file,
177 // returns the name (relative to that .java file) of the file that stores
178 // annotation data for that descriptor. `suffix` is usually empty, but may
179 // (e.g.) be "OrBuilder" for some generated interfaces.
180 template <typename Descriptor>
182  const std::string& suffix) {
183  return descriptor->name() + suffix + ".java.pb.meta";
184 }
185 
186 template <typename Descriptor>
187 void MaybePrintGeneratedAnnotation(Context* context, io::Printer* printer,
188  Descriptor* descriptor, bool immutable,
189  const std::string& suffix = "") {
190  if (IsOwnFile(descriptor, immutable)) {
191  PrintGeneratedAnnotation(printer, '$',
192  context->options().annotate_code
194  : "");
195  }
196 }
197 
198 // Get the unqualified name that should be used for a field's field
199 // number constant.
201 
202 // Returns the type of the FieldDescriptor.
203 // This does nothing interesting for the open source release, but is used for
204 // hacks that improve compatibility with version 1 protocol buffers at Google.
206 
207 enum JavaType {
208  JAVATYPE_INT,
217 };
218 
220 
221 const char* PrimitiveTypeName(JavaType type);
222 
223 // Get the fully-qualified class name for a boxed primitive type, e.g.
224 // "java.lang.Integer" for JAVATYPE_INT. Returns NULL for enum and message
225 // types.
227 
228 // Kotlin source does not distinguish between primitives and non-primitives,
229 // but does use Kotlin-specific qualified types for them.
230 const char* KotlinTypeName(JavaType type);
231 
232 // Get the name of the java enum constant representing this type. E.g.,
233 // "INT32" for FieldDescriptor::TYPE_INT32. The enum constant's full
234 // name is "com.google.protobuf.WireFormat.FieldType.INT32".
236 
237 class ClassNameResolver;
238 std::string DefaultValue(const FieldDescriptor* field, bool immutable,
239  ClassNameResolver* name_resolver);
241  ClassNameResolver* name_resolver) {
242  return DefaultValue(field, true, name_resolver);
243 }
246 
247 // Does this message class have descriptor and reflection methods?
248 inline bool HasDescriptorMethods(const Descriptor* /* descriptor */,
249  bool enforce_lite) {
250  return !enforce_lite;
251 }
252 inline bool HasDescriptorMethods(const EnumDescriptor* /* descriptor */,
253  bool enforce_lite) {
254  return !enforce_lite;
255 }
256 inline bool HasDescriptorMethods(const FileDescriptor* /* descriptor */,
257  bool enforce_lite) {
258  return !enforce_lite;
259 }
260 
261 // Should we generate generic services for this file?
262 inline bool HasGenericServices(const FileDescriptor* file, bool enforce_lite) {
263  return file->service_count() > 0 &&
264  HasDescriptorMethods(file, enforce_lite) &&
265  file->options().java_generic_services();
266 }
267 
268 // Methods for shared bitfields.
269 
270 // Gets the name of the shared bitfield for the given index.
272 
273 // Gets the name of the shared bitfield for the given bit index.
274 // Effectively, GetBitFieldName(bitIndex / 32)
275 std::string GetBitFieldNameForBit(int bitIndex);
276 
277 // Generates the java code for the expression that returns the boolean value
278 // of the bit of the shared bitfields for the given bit index.
279 // Example: "((bitField1_ & 0x04) == 0x04)"
280 std::string GenerateGetBit(int bitIndex);
281 
282 // Generates the java code for the expression that sets the bit of the shared
283 // bitfields for the given bit index.
284 // Example: "bitField1_ = (bitField1_ | 0x04)"
285 std::string GenerateSetBit(int bitIndex);
286 
287 // Generates the java code for the expression that clears the bit of the shared
288 // bitfields for the given bit index.
289 // Example: "bitField1_ = (bitField1_ & ~0x04)"
290 std::string GenerateClearBit(int bitIndex);
291 
292 // Does the same as GenerateGetBit but operates on the bit field on a local
293 // variable. This is used by the builder to copy the value in the builder to
294 // the message.
295 // Example: "((from_bitField1_ & 0x04) == 0x04)"
297 
298 // Does the same as GenerateSetBit but operates on the bit field on a local
299 // variable. This is used by the builder to copy the value in the builder to
300 // the message.
301 // Example: "to_bitField1_ = (to_bitField1_ | 0x04)"
302 std::string GenerateSetBitToLocal(int bitIndex);
303 
304 // Does the same as GenerateGetBit but operates on the bit field on a local
305 // variable. This is used by the parsing constructor to record if a repeated
306 // field is mutable.
307 // Example: "((mutable_bitField1_ & 0x04) == 0x04)"
309 
310 // Does the same as GenerateSetBit but operates on the bit field on a local
311 // variable. This is used by the parsing constructor to record if a repeated
312 // field is mutable.
313 // Example: "mutable_bitField1_ = (mutable_bitField1_ | 0x04)"
315 
316 // Returns whether the JavaType is a reference type.
318 
319 // Returns the capitalized name for calling relative functions in
320 // CodedInputStream
321 const char* GetCapitalizedType(const FieldDescriptor* field, bool immutable);
322 
323 // For encodings with fixed sizes, returns that size in bytes. Otherwise
324 // returns -1.
326 
327 // Comparators used to sort fields in MessageGenerator
328 struct FieldOrderingByNumber {
329  inline bool operator()(const FieldDescriptor* a,
330  const FieldDescriptor* b) const {
331  return a->number() < b->number();
332  }
333 };
334 
335 struct ExtensionRangeOrdering {
336  bool operator()(const Descriptor::ExtensionRange* a,
337  const Descriptor::ExtensionRange* b) const {
338  return a->start < b->start;
339  }
340 };
341 
342 // Sort the fields of the given Descriptor by number into a new[]'d array
343 // and return it. The caller should delete the returned array.
345 
346 // Does this message class have any packed fields?
347 inline bool HasPackedFields(const Descriptor* descriptor) {
348  for (int i = 0; i < descriptor->field_count(); i++) {
349  if (descriptor->field(i)->is_packed()) {
350  return true;
351  }
352  }
353  return false;
354 }
355 
356 // Check a message type and its sub-message types recursively to see if any of
357 // them has a required field. Return true if a required field is found.
359 
360 inline bool IsProto2(const FileDescriptor* descriptor) {
361  return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO2;
362 }
363 
365  return descriptor->containing_oneof() &&
366  !descriptor->containing_oneof()->is_synthetic();
367 }
368 
369 inline bool HasHazzer(const FieldDescriptor* descriptor) {
370  return !descriptor->is_repeated() &&
371  (descriptor->message_type() || descriptor->has_optional_keyword() ||
373 }
374 
375 inline bool HasHasbit(const FieldDescriptor* descriptor) {
376  // Note that currently message fields inside oneofs have hasbits. This is
377  // surprising, as the oneof case should avoid any need for a hasbit. But if
378  // you change this method to remove hasbits for oneofs, a few tests fail.
379  // TODO(b/124347790): remove hasbits for oneofs
380  return !descriptor->is_repeated() &&
381  (descriptor->has_optional_keyword() || IsProto2(descriptor->file()));
382 }
383 
384 // Whether generate classes expose public PARSER instances.
385 inline bool ExposePublicParser(const FileDescriptor* descriptor) {
386  // TODO(liujisi): Mark the PARSER private in 3.1.x releases.
387  return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO2;
388 }
389 
390 // Whether unknown enum values are kept (i.e., not stored in UnknownFieldSet
391 // but in the message and can be queried using additional getters that return
392 // ints.
394  return descriptor->syntax() == FileDescriptor::SYNTAX_PROTO3;
395 }
396 
398  return field->file()->syntax() == FileDescriptor::SYNTAX_PROTO3;
399 }
400 
401 // Check whether a message has repeated fields.
403 
404 inline bool IsMapEntry(const Descriptor* descriptor) {
405  return descriptor->options().map_entry();
406 }
407 
408 inline bool IsMapField(const FieldDescriptor* descriptor) {
409  return descriptor->is_map();
410 }
411 
412 inline bool IsAnyMessage(const Descriptor* descriptor) {
413  return descriptor->full_name() == "google.protobuf.Any";
414 }
415 
416 inline bool IsWrappersProtoFile(const FileDescriptor* descriptor) {
417  return descriptor->name() == "google/protobuf/wrappers.proto";
418 }
419 
420 inline bool CheckUtf8(const FieldDescriptor* descriptor) {
421  return descriptor->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ||
422  descriptor->file()->options().java_string_check_utf8();
423 }
424 
426  return "V3";
427 }
428 
430  std::vector<uint16_t>* output);
431 
432 inline void WriteIntToUtf16CharSequence(int value,
433  std::vector<uint16_t>* output) {
435 }
436 
437 // Escape a UTF-16 character so it can be embedded in a Java string literal.
439 
440 // Only the lowest two bytes of the return value are used. The lowest byte
441 // is the integer value of a j/c/g/protobuf/FieldType enum. For the other
442 // byte:
443 // bit 0: whether the field is required.
444 // bit 1: whether the field requires UTF-8 validation.
445 // bit 2: whether the field needs isInitialized check.
446 // bit 3: whether the field is a map field with proto2 enum value.
447 // bits 4-7: unused
449 
450 // To get the total number of entries need to be built for experimental runtime
451 // and the first field number that are not in the table part
453  const FieldDescriptor** fields, int count);
454 } // namespace java
455 } // namespace compiler
456 } // namespace protobuf
457 } // namespace google
458 
459 #endif // GOOGLE_PROTOBUF_COMPILER_JAVA_HELPERS_H__
google::protobuf::FieldDescriptor::Type
Type
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:521
google::protobuf::compiler::java::UnderscoresToCamelCase
std::string UnderscoresToCamelCase(const std::string &input, bool cap_next_letter)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:157
google::protobuf::compiler::java::AnnotationFileName
std::string AnnotationFileName(const Descriptor *descriptor, const std::string &suffix)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:181
google::protobuf::compiler::java::ExtensionRangeOrdering::operator()
bool operator()(const Descriptor::ExtensionRange *a, const Descriptor::ExtensionRange *b) const
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.h:336
google::protobuf::compiler::java::GenerateClearBit
std::string GenerateClearBit(int bitIndex)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:670
google::protobuf::compiler::java::IsDescriptorProto
bool IsDescriptorProto(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:147
google::protobuf::compiler::java::MaybePrintGeneratedAnnotation
void MaybePrintGeneratedAnnotation(Context *context, io::Printer *printer, Descriptor *descriptor, bool immutable, const std::string &suffix="")
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:187
google::protobuf::compiler::java::UnderscoresToCamelCaseCheckReserved
std::string UnderscoresToCamelCaseCheckReserved(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:210
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf::compiler::java::kThinSeparator
const char kThinSeparator[]
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:60
google::protobuf::compiler::java::ToUpperCh
char ToUpperCh(char ch)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.cc:220
google::protobuf::compiler::java::HasDescriptorMethods
bool HasDescriptorMethods(const Descriptor *descriptor, bool enforce_lite)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:242
google::protobuf::compiler::java::JAVATYPE_INT
@ JAVATYPE_INT
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:206
google::protobuf::compiler::java::IsMapEntry
bool IsMapEntry(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:375
google::protobuf::compiler::java::GenerateGetBitMutableLocal
std::string GenerateGetBitMutableLocal(int bitIndex)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:687
google::protobuf::compiler::java::IsByteStringWithCustomDefaultValue
bool IsByteStringWithCustomDefaultValue(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:610
uint16_t
unsigned short uint16_t
Definition: stdint-msvc2008.h:79
google::protobuf::compiler::java::JAVATYPE_BOOLEAN
@ JAVATYPE_BOOLEAN
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:210
google::protobuf::compiler::java::HasRepeatedFields
bool HasRepeatedFields(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:880
google::protobuf::compiler::java::ShortMutableJavaClassName
std::string ShortMutableJavaClassName(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:140
google::protobuf::FileDescriptor::SYNTAX_PROTO2
@ SYNTAX_PROTO2
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1393
google::protobuf::compiler::java::GenerateSetBit
std::string GenerateSetBit(int bitIndex)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:666
google::protobuf::compiler::java::JAVATYPE_LONG
@ JAVATYPE_LONG
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:207
FileDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:128
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::compiler::java::ToCamelCase
std::string ToCamelCase(const std::string &input, bool lower_first)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.cc:196
google::protobuf::compiler::java::MultipleJavaFiles
bool MultipleJavaFiles(const FileDescriptor *descriptor, bool immutable)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:158
file
Definition: bloaty/third_party/zlib/examples/gzappend.c:170
grpc::protobuf::io::Printer
GRPC_CUSTOM_PRINTER Printer
Definition: src/compiler/config.h:54
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::compiler::java::ImmutableDefaultValue
std::string ImmutableDefaultValue(const FieldDescriptor *field, ClassNameResolver *name_resolver)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:234
google::protobuf::compiler::java::UnderscoresToCapitalizedCamelCase
std::string UnderscoresToCapitalizedCamelCase(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:198
setup.name
name
Definition: setup.py:542
google::protobuf::compiler::java::PrintEnumVerifierLogic
void PrintEnumVerifierLogic(io::Printer *printer, const FieldDescriptor *descriptor, const std::map< std::string, std::string > &variables, const char *var_name, const char *terminating_string, bool enforce_lite)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:136
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
google::protobuf::compiler::java::HasGenericServices
bool HasGenericServices(const FileDescriptor *file, bool enforce_lite)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:256
google::protobuf::compiler::java::KotlinTypeName
const char * KotlinTypeName(JavaType type)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.cc:473
google::protobuf::compiler::java::GetExperimentalJavaFieldType
int GetExperimentalJavaFieldType(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:959
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
google::protobuf::compiler::java::CamelCaseFieldName
std::string CamelCaseFieldName(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:222
google::protobuf::compiler::java::JAVATYPE_FLOAT
@ JAVATYPE_FLOAT
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:208
google::protobuf::compiler::java::IsRealOneof
bool IsRealOneof(const FieldDescriptor *descriptor)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.h:364
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google::protobuf::FileDescriptor::SYNTAX_PROTO3
@ SYNTAX_PROTO3
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1394
google::protobuf::compiler::java::HasHasbit
bool HasHasbit(const FieldDescriptor *descriptor)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.h:375
google::protobuf::compiler::java::CheckUtf8
bool CheckUtf8(const FieldDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:391
google::protobuf::compiler::java::ExtraMessageOrBuilderInterfaces
std::string ExtraMessageOrBuilderInterfaces(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:303
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::compiler::java::IsMapField
bool IsMapField(const FieldDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:379
google::protobuf::compiler::java::IsDefaultValueJavaDefault
bool IsDefaultValueJavaDefault(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:578
google::protobuf::compiler::java::BoxedPrimitiveTypeName
const char * BoxedPrimitiveTypeName(JavaType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:398
google::protobuf::compiler::java::IsForbiddenKotlin
bool IsForbiddenKotlin(const std::string &field_name)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.cc:252
google::protobuf::compiler::java::SupportUnknownEnumValue
bool SupportUnknownEnumValue(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:368
google::protobuf::compiler::java::IsWrappersProtoFile
bool IsWrappersProtoFile(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:387
gmock_output_test.output
output
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
google::protobuf::compiler::java::JavaPackageToDir
std::string JavaPackageToDir(std::string package_name)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:263
google::protobuf::compiler::java::kThickSeparator
const char kThickSeparator[]
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:58
google::protobuf::compiler::java::PrintGeneratedAnnotation
void PrintGeneratedAnnotation(io::Printer *printer, char delimiter, const std::string &annotation_file)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:122
google::protobuf::compiler::java::ExposePublicParser
bool ExposePublicParser(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:360
google::protobuf::compiler::java::FileClassName
std::string FileClassName(const FileDescriptor *file, bool immutable)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:238
grpc::protobuf::MethodDescriptor
GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor
Definition: include/grpcpp/impl/codegen/config_protobuf.h:87
google::protobuf::compiler::java::GetJavaType
JavaType GetJavaType(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:319
google::protobuf::compiler::java::ExtraMessageInterfaces
std::string ExtraMessageInterfaces(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:290
google::protobuf::compiler::java::IsReferenceType
bool IsReferenceType(JavaType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:695
google::protobuf::compiler::java::GenerateSetBitToLocal
std::string GenerateSetBitToLocal(int bitIndex)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:683
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
google::protobuf::compiler::java::GetBitFieldName
std::string GetBitFieldName(int index)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:629
google::protobuf::compiler::java::GetTableDrivenNumberOfEntriesAndLookUpStartFieldNumber
std::pair< int, int > GetTableDrivenNumberOfEntriesAndLookUpStartFieldNumber(const FieldDescriptor **fields, int count)
google::protobuf::compiler::java::FixedSize
int FixedSize(FieldDescriptor::Type type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:774
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
EnumDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:143
google::protobuf::compiler::java::FileJavaPackage
std::string FileJavaPackage(const FileDescriptor *file, bool immutable)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:243
google::protobuf::compiler::java::WriteUInt32ToUtf16CharSequence
void WriteUInt32ToUtf16CharSequence(uint32 number, std::vector< uint16 > *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:904
google::protobuf::compiler::java::JAVATYPE_BYTES
@ JAVATYPE_BYTES
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:212
google::protobuf::compiler::java::HasHazzer
bool HasHazzer(const FieldDescriptor *descriptor)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.h:369
google::protobuf::compiler::java::GetType
FieldDescriptor::Type GetType(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:315
java
field
const FieldDescriptor * field
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/parser_unittest.cc:2692
suffix
unsigned char suffix[65536]
Definition: bloaty/third_party/zlib/examples/gun.c:164
google::protobuf::compiler::java::FieldTypeName
const char * FieldTypeName(FieldDescriptor::Type field_type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:443
google::protobuf::compiler::java::IsProto2
bool IsProto2(const FileDescriptor *descriptor)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.h:360
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
google::protobuf::compiler::java::GetBitFieldNameForBit
std::string GetBitFieldNameForBit(int bitIndex)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:636
google::protobuf::compiler::java::UniqueFileScopeIdentifier
std::string UniqueFileScopeIdentifier(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:218
google::protobuf::compiler::java::GenerateSetBitMutableLocal
std::string GenerateSetBitMutableLocal(int bitIndex)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:691
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
profile_analyzer.fields
list fields
Definition: profile_analyzer.py:266
google::protobuf::compiler::java::JAVATYPE_DOUBLE
@ JAVATYPE_DOUBLE
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:209
google::protobuf::compiler::java::ToLowerCh
char ToLowerCh(char ch)
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.cc:224
field_type
zend_class_entry * field_type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/message.c:2030
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
google::protobuf::compiler::java::GetOneofStoredType
std::string GetOneofStoredType(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:431
google::protobuf::compiler::java::JAVATYPE_ENUM
@ JAVATYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:213
google::protobuf::compiler::java::ExtraBuilderInterfaces
std::string ExtraBuilderInterfaces(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:297
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
google::protobuf::FileDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1320
google::protobuf::compiler::java::FieldConstantName
std::string FieldConstantName(const FieldDescriptor *field)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:309
google::protobuf::compiler::java::FieldOrderingByNumber::operator()
bool operator()(const FieldDescriptor *a, const FieldDescriptor *b) const
Definition: protobuf/src/google/protobuf/compiler/java/java_helpers.h:329
google::protobuf::compiler::java::DefaultValue
std::string DefaultValue(const FieldDescriptor *field, bool immutable, ClassNameResolver *name_resolver)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:499
google::protobuf::compiler::java::GenerateGetBit
std::string GenerateGetBit(int bitIndex)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:662
google::protobuf::compiler::java::JAVATYPE_MESSAGE
@ JAVATYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:214
context
grpc::ClientContext context
Definition: istio_echo_server_lib.cc:61
google::protobuf::compiler::java::HasRequiredFields
bool HasRequiredFields(const Descriptor *type, std::unordered_set< const Descriptor * > *already_seen)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:840
google::protobuf::compiler::java::JAVATYPE_STRING
@ JAVATYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:211
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
code
Definition: bloaty/third_party/zlib/contrib/infback9/inftree9.h:24
google::protobuf::compiler::java::GetCapitalizedType
const char * GetCapitalizedType(const FieldDescriptor *field, bool immutable)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:724
ch
char ch
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3621
google::protobuf::compiler::java::ExtraMutableMessageInterfaces
std::string ExtraMutableMessageInterfaces(const Descriptor *descriptor)
google::protobuf::compiler::java::IsOwnFile
bool IsOwnFile(const Descriptor *descriptor, bool immutable)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:166
google::protobuf::compiler::java::JavaType
JavaType
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:205
google::protobuf::compiler::java::HasPackedFields
bool HasPackedFields(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:341
google::protobuf::compiler::java::PrimitiveTypeName
const char * PrimitiveTypeName(JavaType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:365
google::protobuf::compiler::java::SortFieldsByNumber
const FieldDescriptor ** SortFieldsByNumber(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:824
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
google::protobuf::compiler::java::WriteIntToUtf16CharSequence
void WriteIntToUtf16CharSequence(int value, std::vector< uint16 > *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:402
grpc::protobuf::ServiceDescriptor
GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor
Definition: include/grpcpp/impl/codegen/config_protobuf.h:88
compiler
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc:21
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf::compiler::java::GeneratedCodeVersionSuffix
std::string GeneratedCodeVersionSuffix()
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:396
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::method
const Descriptor::ReservedRange const EnumValueDescriptor method
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1973
google::protobuf::compiler::java::GenerateGetBitFromLocal
std::string GenerateGetBitFromLocal(int bitIndex)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:679
google::protobuf::compiler::java::IsAnyMessage
bool IsAnyMessage(const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.h:383
google::protobuf::compiler::java::EscapeUtf16ToString
void EscapeUtf16ToString(uint16 code, std::string *output)
Definition: bloaty/third_party/protobuf/src/google/protobuf/compiler/java/java_helpers.cc:998


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:09