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

Describes a message type. More...

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

Classes

class  FieldCollection
 A collection to simplify retrieving the field accessor for a particular field. More...
 

Public Member Functions

FieldDescriptor FindFieldByName (String name)
 Finds a field by field name. More...
 

Public Attributes

override string Name => Proto.Name
 The brief name of the descriptor's target. More...
 

Properties

Type ClrType [get]
 The CLR type used to represent message instances from this descriptor. More...
 
MessageParser Parser [get]
 A parser for this message type. More...
 
MessageDescriptor ContainingType [get]
 
FieldCollection Fields [get]
 
IList< MessageDescriptorNestedTypes [get]
 
IList< EnumDescriptorEnumTypes [get]
 
IList< OneofDescriptorOneofs [get]
 
- 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

Describes a message type.

Member Function Documentation

◆ FindFieldByName()

FieldDescriptor Google.Protobuf.Reflection.MessageDescriptor.FindFieldByName ( String  name)
inline

Finds a field by field name.

Parameters
nameThe unqualified name of the field (e.g. "foo").
Returns
The field's descriptor, or null if not found.

Member Data Documentation

◆ Name

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

The brief name of the descriptor's target.

Property Documentation

◆ ClrType

Type Google.Protobuf.Reflection.MessageDescriptor.ClrType
get

The CLR type used to represent message instances from this descriptor.

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, so this property will return null in such cases.

For wrapper types (Google.Protobuf.WellKnownTypes.StringValue and the like), the type returned here will be the generated message type, not the native type used by reflection for fields of those types. Code using reflection should call IsWrapperType to determine whether a message descriptor represents a wrapper type, and handle the result appropriately.

◆ ContainingType

MessageDescriptor Google.Protobuf.Reflection.MessageDescriptor.ContainingType
get

If this is a nested type, get the outer descriptor, otherwise null.

◆ EnumTypes

IList<EnumDescriptor> Google.Protobuf.Reflection.MessageDescriptor.EnumTypes
get

An unmodifiable list of this message type's enum types.

◆ Fields

FieldCollection Google.Protobuf.Reflection.MessageDescriptor.Fields
get

A collection of fields, which can be retrieved by name or field number.

◆ NestedTypes

IList<MessageDescriptor> Google.Protobuf.Reflection.MessageDescriptor.NestedTypes
get

An unmodifiable list of this message type's nested types.

◆ Oneofs

IList<OneofDescriptor> Google.Protobuf.Reflection.MessageDescriptor.Oneofs
get

An unmodifiable list of the "oneof" field collections in this message type.

◆ Parser

MessageParser Google.Protobuf.Reflection.MessageDescriptor.Parser
get

A parser for this message type.

As MessageDescriptor is not generic, this cannot be statically typed to the relevant type, but it should produce objects of a type compatible with ClrType.

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. No message parser object is created for such messages, so this property will return null in such cases.

For wrapper types (Google.Protobuf.WellKnownTypes.StringValue and the like), the parser returned here will be the generated message type, not the native type used by reflection for fields of those types. Code using reflection should call IsWrapperType to determine whether a message descriptor represents a wrapper type, and handle the result appropriately.


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