• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_LITE_FIELD_GENERATOR_H__
2 #define GOOGLE_PROTOBUF_COMPILER_JAVA_LITE_FIELD_GENERATOR_H__
3 
4 #include <string>
5 
6 #include "absl/log/absl_log.h"
7 #include "google/protobuf/compiler/java/generator_common.h"
8 #include "google/protobuf/io/printer.h"
9 
10 namespace google {
11 namespace protobuf {
12 namespace compiler {
13 namespace java {
14 
15 class ImmutableFieldLiteGenerator : public FieldGenerator {
16  public:
17   ImmutableFieldLiteGenerator() = default;
18   ImmutableFieldLiteGenerator(const ImmutableFieldLiteGenerator&) = delete;
19   ImmutableFieldLiteGenerator& operator=(const ImmutableFieldLiteGenerator&) =
20       delete;
21   virtual ~ImmutableFieldLiteGenerator() = default;
22 
23   virtual int GetNumBitsForMessage() const = 0;
24   virtual void GenerateInterfaceMembers(io::Printer* printer) const = 0;
25   virtual void GenerateMembers(io::Printer* printer) const = 0;
26   virtual void GenerateBuilderMembers(io::Printer* printer) const = 0;
27   virtual void GenerateInitializationCode(io::Printer* printer) const = 0;
28   virtual void GenerateFieldInfo(io::Printer* printer,
29                                  std::vector<uint16_t>* output) const = 0;
30 
GenerateSerializationCode(io::Printer * printer)31   void GenerateSerializationCode(io::Printer* printer) const override {
32     ABSL_LOG(FATAL) << "GenerateSerializationCode is unsupported for lite.";
33   }
34 
35   virtual std::string GetBoxedType() const = 0;
36 };
37 
38 }  // namespace java
39 }  // namespace compiler
40 }  // namespace protobuf
41 }  // namespace google
42 
43 #endif  // GOOGLE_PROTOBUF_COMPILER_JAVA_LITE_FIELD_GENERATOR_H__
44