File indexing completed on 2025-01-31 10:11:57
0001 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_IMMUTABLE_FIELD_GENERATOR_H__
0002 #define GOOGLE_PROTOBUF_COMPILER_JAVA_IMMUTABLE_FIELD_GENERATOR_H__
0003
0004 #include <string>
0005
0006 #include "google/protobuf/compiler/java/generator_common.h"
0007 #include "google/protobuf/io/printer.h"
0008
0009 namespace google {
0010 namespace protobuf {
0011 namespace compiler {
0012 namespace java {
0013
0014 class ImmutableFieldGenerator : public FieldGenerator {
0015 public:
0016 ImmutableFieldGenerator() = default;
0017 ImmutableFieldGenerator(const ImmutableFieldGenerator&) = delete;
0018 ImmutableFieldGenerator& operator=(const ImmutableFieldGenerator&) = delete;
0019 ~ImmutableFieldGenerator() override = default;
0020
0021 virtual int GetMessageBitIndex() const = 0;
0022 virtual int GetBuilderBitIndex() const = 0;
0023 virtual int GetNumBitsForMessage() const = 0;
0024 virtual int GetNumBitsForBuilder() const = 0;
0025 virtual void GenerateInterfaceMembers(io::Printer* printer) const = 0;
0026 virtual void GenerateMembers(io::Printer* printer) const = 0;
0027 virtual void GenerateBuilderMembers(io::Printer* printer) const = 0;
0028 virtual void GenerateInitializationCode(io::Printer* printer) const = 0;
0029 virtual void GenerateBuilderClearCode(io::Printer* printer) const = 0;
0030 virtual void GenerateMergingCode(io::Printer* printer) const = 0;
0031 virtual void GenerateBuildingCode(io::Printer* printer) const = 0;
0032 virtual void GenerateBuilderParsingCode(io::Printer* printer) const = 0;
0033 virtual void GenerateSerializedSizeCode(io::Printer* printer) const = 0;
0034 virtual void GenerateFieldBuilderInitializationCode(
0035 io::Printer* printer) const = 0;
0036 virtual void GenerateKotlinDslMembers(io::Printer* printer) const = 0;
0037
0038 virtual void GenerateBuilderParsingCodeFromPacked(
0039 io::Printer* printer) const {
0040 ReportUnexpectedPackedFieldsCall();
0041 }
0042
0043 virtual void GenerateEqualsCode(io::Printer* printer) const = 0;
0044 virtual void GenerateHashCode(io::Printer* printer) const = 0;
0045
0046 virtual std::string GetBoxedType() const = 0;
0047 };
0048
0049 }
0050 }
0051 }
0052 }
0053
0054 #endif