Google.Protobuf.Reflection.IFieldAccessor

Allows fields to be reflectively accessed.

Summary

Inheritance

Direct Known Subclasses:Google.Protobuf.Reflection.FieldAccessorBase

Properties

Descriptor
Returns the descriptor associated with this field.

Public functions

Clear(IMessage message)
void
Clears the field in the specified message.
GetValue(IMessage message)
object
Fetches the field value.
SetValue(IMessage message, object value)
void
Mutator for single "simple" fields only.

Properties

Descriptor

FieldDescriptor Descriptor

Returns the descriptor associated with this field.

Public functions

Clear

void Clear(
  IMessage message
)

Clears the field in the specified message.

(For repeated fields, this clears the list.)

GetValue

object GetValue(
  IMessage message
)

Fetches the field value.

For repeated values, this will be an IList implementation. For map values, this will be an IDictionary implementation.

SetValue

void SetValue(
  IMessage message,
  object value
)

Mutator for single "simple" fields only.

Repeated fields are mutated by fetching the value and manipulating it as a list. Map fields are mutated by fetching the value and manipulating it as a dictionary.

Details
Exceptions
InvalidOperationException
The field is not a "simple" field.