diff options
author | Jon Skeet <jonskeet@google.com> | 2018-08-08 19:51:16 -0700 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2018-08-20 22:00:02 +0100 |
commit | 228530e2da79603450948d5d701fe4bb4e47c430 (patch) | |
tree | dc91239e2eccfe0751ce8f9e34dcaaaafb8485dd /csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs | |
parent | fa252ec2a54acb24ddc87d48fed1ecfd458445fd (diff) | |
download | protobuf-228530e2da79603450948d5d701fe4bb4e47c430.tar.gz protobuf-228530e2da79603450948d5d701fe4bb4e47c430.tar.bz2 protobuf-228530e2da79603450948d5d701fe4bb4e47c430.zip |
Support creating FileDescriptors dynamically from binary data.
Related to #658 and #5007.
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index 2a3d5c7a..152467d8 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -116,13 +116,18 @@ namespace Google.Protobuf.Reflection /// that is the responsibility of the accessor. /// </para> /// <para> - /// The value returned by this property will be non-null for all regular fields. However, - /// if a message containing a map field is introspected, the list of nested messages will include + /// In descriptors for generated code, the value returned by this property will be non-null for all + /// regular fields. However, if a message containing a map field is introspected, the list of nested messages will include /// an auto-generated nested key/value pair message for the field. This is not represented in any /// generated type, and the value of the map field itself is represented by a dictionary in the /// reflection API. There are never instances of those "hidden" messages, so no accessor is provided /// and this property will return null. /// </para> + /// <para> + /// In dynamically loaded descriptors, the value returned by this property will current be null; + /// if and when dynamic messages are supported, it will return a suitable accessor to work with + /// them. + /// </para> /// </remarks> public IFieldAccessor Accessor => accessor; @@ -330,7 +335,8 @@ namespace Google.Protobuf.Reflection private IFieldAccessor CreateAccessor() { // If we're given no property name, that's because we really don't want an accessor. - // (At the moment, that means it's a map entry message...) + // This could be because it's a map message, or it could be that we're loading a FileDescriptor dynamically. + // TODO: Support dynamic messages. if (propertyName == null) { return null; |