File indexing completed on 2026-09-19 09:23:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__
0015 #define GOOGLE_PROTOBUF_COMPILER_JAVA_GENERATOR_H__
0016
0017 #include <cstdint>
0018 #include <string>
0019 #include <vector>
0020
0021 #include "google/protobuf/compiler/java/java_features.pb.h"
0022 #include "google/protobuf/compiler/code_generator.h"
0023 #include "google/protobuf/descriptor.pb.h"
0024 #include "google/protobuf/port.h"
0025
0026
0027 #include "google/protobuf/port_def.inc"
0028
0029 namespace google {
0030 namespace protobuf {
0031 namespace compiler {
0032 namespace java {
0033
0034
0035
0036
0037
0038 class PROTOC_EXPORT JavaGenerator : public CodeGenerator {
0039 public:
0040 JavaGenerator();
0041 JavaGenerator(const JavaGenerator&) = delete;
0042 JavaGenerator& operator=(const JavaGenerator&) = delete;
0043 ~JavaGenerator() override;
0044
0045
0046 bool Generate(const FileDescriptor* file, const std::string& parameter,
0047 GeneratorContext* context, std::string* error) const override;
0048
0049 uint64_t GetSupportedFeatures() const override;
0050
0051 Edition GetMinimumEdition() const override { return Edition::EDITION_PROTO2; }
0052 Edition GetMaximumEdition() const override {
0053 return Edition::EDITION_2024;
0054 }
0055
0056 std::vector<const FieldDescriptor*> GetFeatureExtensions() const override {
0057 return {GetExtensionReflection(pb::java)};
0058 }
0059
0060 void set_opensource_runtime(bool opensource) {
0061 opensource_runtime_ = opensource;
0062 }
0063
0064 using CodeGenerator::GetEdition;
0065 using CodeGenerator::GetResolvedSourceFeatureExtension;
0066 using CodeGenerator::GetResolvedSourceFeatures;
0067 using CodeGenerator::GetUnresolvedSourceFeatures;
0068
0069 private:
0070 bool opensource_runtime_ = google::protobuf::internal::IsOss();
0071 };
0072
0073 }
0074 }
0075 }
0076 }
0077
0078 #include "google/protobuf/port_undef.inc"
0079
0080 #endif