aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/java/java_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/java/java_context.h')
-rw-r--r--src/google/protobuf/compiler/java/java_context.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/java/java_context.h b/src/google/protobuf/compiler/java/java_context.h
index 5b595d07..a480e45d 100644
--- a/src/google/protobuf/compiler/java/java_context.h
+++ b/src/google/protobuf/compiler/java/java_context.h
@@ -46,6 +46,7 @@ namespace protobuf {
class FieldDescriptor;
class OneofDescriptor;
class Descriptor;
+ class EnumDescriptor;
namespace compiler {
namespace java {
class ClassNameResolver; // name_resolver.h
@@ -78,6 +79,20 @@ class Context {
const OneofGeneratorInfo* GetOneofGeneratorInfo(
const OneofDescriptor* oneof) const;
+ // Enforces all the files (including transitive dependencies) to use
+ // LiteRuntime.
+ void SetEnforceLite(bool enforce_lite) {
+ enforce_lite_ = enforce_lite;
+ }
+
+ bool EnforceLite() const {
+ return enforce_lite_;
+ }
+
+ // Does this message class have generated parsing, serialization, and other
+ // standard methods for which reflection-based fallback implementations exist?
+ bool HasGeneratedMethods(const Descriptor* descriptor) const;
+
private:
void InitializeFieldGeneratorInfo(const FileDescriptor* file);
void InitializeFieldGeneratorInfoForMessage(const Descriptor* message);
@@ -87,6 +102,7 @@ class Context {
google::protobuf::scoped_ptr<ClassNameResolver> name_resolver_;
map<const FieldDescriptor*, FieldGeneratorInfo> field_generator_info_map_;
map<const OneofDescriptor*, OneofGeneratorInfo> oneof_generator_info_map_;
+ bool enforce_lite_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Context);
};