File indexing completed on 2025-01-31 10:11:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__
0013 #define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__
0014
0015 #include <string>
0016
0017 #include "absl/container/flat_hash_map.h"
0018 #include "google/protobuf/compiler/java/generator_factory.h"
0019 #include "google/protobuf/port.h"
0020
0021 namespace google {
0022 namespace protobuf {
0023 class FieldDescriptor;
0024 namespace compiler {
0025 namespace java {
0026 class Context;
0027 class ClassNameResolver;
0028 }
0029 }
0030 namespace io {
0031 class Printer;
0032 }
0033 }
0034 }
0035
0036 namespace google {
0037 namespace protobuf {
0038 namespace compiler {
0039 namespace java {
0040
0041 class ImmutableExtensionGenerator : public ExtensionGenerator {
0042 public:
0043 explicit ImmutableExtensionGenerator(const FieldDescriptor* descriptor,
0044 Context* context);
0045 ImmutableExtensionGenerator(const ImmutableExtensionGenerator&) = delete;
0046 ImmutableExtensionGenerator& operator=(const ImmutableExtensionGenerator&) =
0047 delete;
0048 ~ImmutableExtensionGenerator() override;
0049
0050 void Generate(io::Printer* printer) override;
0051 int GenerateNonNestedInitializationCode(io::Printer* printer) override;
0052 int GenerateRegistrationCode(io::Printer* printer) override;
0053
0054 protected:
0055 const FieldDescriptor* descriptor_;
0056 ClassNameResolver* name_resolver_;
0057 std::string scope_;
0058 Context* context_;
0059 };
0060
0061 }
0062 }
0063 }
0064 }
0065
0066 #endif