webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Public Attributes | Properties | List of all members
Google.Protobuf.Reflection.FieldDescriptor Class Reference

Descriptor for a field or extension within a message in a .proto file. More...

Inheritance diagram for Google.Protobuf.Reflection.FieldDescriptor:
Google.Protobuf.Reflection.DescriptorBase Google.Protobuf.Reflection.IDescriptor

Public Member Functions

int CompareTo (FieldDescriptor other)
 Compares this descriptor with another one, ordering in "canonical" order which simply means ascending order by field number. other must be a field of the same type, i.e. the ContainingType of both fields must be the same. More...
 

Public Attributes

override string Name => Proto.Name
 The brief name of the descriptor's target. More...
 
IFieldAccessor Accessor => accessor
 Returns the accessor for this field. More...
 
bool IsRepeated => Proto.Label == FieldDescriptorProto.Types.Label.Repeated
 Returns true if this field is a repeated field; false otherwise. More...
 
bool IsMap => fieldType == FieldType.Message && messageType.Proto.Options != null && messageType.Proto.Options.MapEntry
 Returns true if this field is a map field; false otherwise. More...
 
bool IsPacked
 Returns true if this field is a packed, repeated field; false otherwise. More...
 
FieldType FieldType => fieldType
 Returns the type of the field. More...
 
int FieldNumber => Proto.Number
 Returns the field number declared in the proto file. More...
 

Properties

MessageDescriptor ContainingType [get]
 Get the field's containing message type. More...
 
OneofDescriptor ContainingOneof [get]
 Returns the oneof containing this field, or null if it is not part of a oneof. More...
 
string JsonName [get]
 The effective JSON name for this field. This is usually the lower-camel-cased form of the field name, but can be overridden using the json_name option in the .proto file. More...
 
EnumDescriptor EnumType [get]
 For enum fields, returns the field's type. More...
 
MessageDescriptor MessageType [get]
 For embedded message and group fields, returns the field's type. More...
 
- Properties inherited from Google.Protobuf.Reflection.DescriptorBase
int Index [get]
 
abstract string Name [get]
 Returns the name of the entity (field, message etc) being described. More...
 
string FullName [get]
 The fully qualified name of the descriptor's target. More...
 
FileDescriptor File [get]
 
- Properties inherited from Google.Protobuf.Reflection.IDescriptor
string Name [get]
 Returns the name of the entity (message, field etc) being described. More...
 
string FullName [get]
 Returns the fully-qualified name of the entity being described. More...
 
FileDescriptor File [get]
 Returns the descriptor for the .proto file that this entity is part of. More...
 

Detailed Description

Descriptor for a field or extension within a message in a .proto file.

Member Function Documentation

◆ CompareTo()

int Google.Protobuf.Reflection.FieldDescriptor.CompareTo ( FieldDescriptor  other)
inline

Compares this descriptor with another one, ordering in "canonical" order which simply means ascending order by field number. other must be a field of the same type, i.e. the ContainingType of both fields must be the same.

Member Data Documentation

◆ Accessor

IFieldAccessor Google.Protobuf.Reflection.FieldDescriptor.Accessor => accessor

Returns the accessor for this field.

While a FieldDescriptor describes the field, it does not provide any way of obtaining or changing the value of the field within a specific message; that is the responsibility of the accessor.

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.

◆ FieldNumber

int Google.Protobuf.Reflection.FieldDescriptor.FieldNumber => Proto.Number

Returns the field number declared in the proto file.

◆ FieldType

FieldType Google.Protobuf.Reflection.FieldDescriptor.FieldType => fieldType

Returns the type of the field.

◆ IsMap

bool Google.Protobuf.Reflection.FieldDescriptor.IsMap => fieldType == FieldType.Message && messageType.Proto.Options != null && messageType.Proto.Options.MapEntry

Returns true if this field is a map field; false otherwise.

◆ IsPacked

bool Google.Protobuf.Reflection.FieldDescriptor.IsPacked
Initial value:
=>
Proto.Options == null || Proto.Options.Packed

Returns true if this field is a packed, repeated field; false otherwise.

◆ IsRepeated

bool Google.Protobuf.Reflection.FieldDescriptor.IsRepeated => Proto.Label == FieldDescriptorProto.Types.Label.Repeated

Returns true if this field is a repeated field; false otherwise.

◆ Name

override string Google.Protobuf.Reflection.FieldDescriptor.Name => Proto.Name

The brief name of the descriptor's target.

Property Documentation

◆ ContainingOneof

OneofDescriptor Google.Protobuf.Reflection.FieldDescriptor.ContainingOneof
get

Returns the oneof containing this field, or null if it is not part of a oneof.

◆ ContainingType

MessageDescriptor Google.Protobuf.Reflection.FieldDescriptor.ContainingType
get

Get the field's containing message type.

◆ EnumType

EnumDescriptor Google.Protobuf.Reflection.FieldDescriptor.EnumType
get

For enum fields, returns the field's type.

◆ JsonName

string Google.Protobuf.Reflection.FieldDescriptor.JsonName
get

The effective JSON name for this field. This is usually the lower-camel-cased form of the field name, but can be overridden using the json_name option in the .proto file.

◆ MessageType

MessageDescriptor Google.Protobuf.Reflection.FieldDescriptor.MessageType
get

For embedded message and group fields, returns the field's type.


The documentation for this class was generated from the following file: