aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/java/java_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/java/java_helpers.h')
-rw-r--r--src/google/protobuf/compiler/java/java_helpers.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/java/java_helpers.h b/src/google/protobuf/compiler/java/java_helpers.h
index bd565ced..1ab168c4 100644
--- a/src/google/protobuf/compiler/java/java_helpers.h
+++ b/src/google/protobuf/compiler/java/java_helpers.h
@@ -136,6 +136,13 @@ inline string ShortMutableJavaClassName(const Descriptor* descriptor) {
return descriptor->name();
}
+// Whether the given descriptor is for one of the core descriptor protos. We
+// cannot currently use the new runtime with core protos since there is a
+// bootstrapping problem with obtaining their descriptors.
+inline bool IsDescriptorProto(const Descriptor* descriptor) {
+ return descriptor->file()->name() == "google/protobuf/descriptor.proto";
+}
+
// Whether we should generate multiple java files for messages.
inline bool MultipleJavaFiles(
@@ -371,6 +378,10 @@ inline bool IsAnyMessage(const Descriptor* descriptor) {
return descriptor->full_name() == "google.protobuf.Any";
}
+inline bool IsWrappersProtoFile(const FileDescriptor* descriptor) {
+ return descriptor->name() == "google/protobuf/wrappers.proto";
+}
+
inline bool CheckUtf8(const FieldDescriptor* descriptor) {
return descriptor->file()->syntax() == FileDescriptor::SYNTAX_PROTO3 ||
descriptor->file()->options().java_string_check_utf8();
@@ -379,6 +390,10 @@ inline bool CheckUtf8(const FieldDescriptor* descriptor) {
inline string GeneratedCodeVersionSuffix() {
return "V3";
}
+
+inline bool EnableExperimentalRuntime(Context* context) {
+ return false;
+}
} // namespace java
} // namespace compiler
} // namespace protobuf