Google.Protobuf.Reflection.TypeRegistry

An immutable registry of types which can be looked up by their full name.

Summary

Properties

Empty
TypeRegistry
An empty type registry, containing no types.

Public functions

Find(string fullName)
MessageDescriptor
Attempts to find a message descriptor by its full name.

Public static functions

FromFiles(params FileDescriptor[] fileDescriptors)
TypeRegistry
Creates a type registry from the specified set of file descriptors.
FromFiles(IEnumerable< FileDescriptor > fileDescriptors)
TypeRegistry
Creates a type registry from the specified set of file descriptors.
FromMessages(params MessageDescriptor[] messageDescriptors)
TypeRegistry
Creates a type registry from the file descriptor parents of the specified set of message descriptors.
FromMessages(IEnumerable< MessageDescriptor > messageDescriptors)
TypeRegistry
Creates a type registry from the file descriptor parents of the specified set of message descriptors.

Properties

Empty

TypeRegistry Empty

An empty type registry, containing no types.

Public functions

Find

MessageDescriptor Find(
  string fullName
)

Attempts to find a message descriptor by its full name.

Details
Parameters
fullName
The full name of the message, which is the dot-separated combination of package, containing messages and message name
Returns
The message descriptor corresponding to fullName or null if there is no such message descriptor.

Public static functions

FromFiles

TypeRegistry FromFiles(
  params FileDescriptor[] fileDescriptors
)

Creates a type registry from the specified set of file descriptors.

This is a convenience overload for FromFiles(IEnumerable{FileDescriptor}) to allow calls such as TypeRegistry.FromFiles(descriptor1, descriptor2).

Details
Parameters
fileDescriptors
The set of files to include in the registry. Must not contain null values.
Returns
A type registry for the given files.

FromFiles

TypeRegistry FromFiles(
  IEnumerable< FileDescriptor > fileDescriptors
)

Creates a type registry from the specified set of file descriptors.

All message types within all the specified files are added to the registry, and the dependencies of the specified files are also added, recursively.

Details
Parameters
fileDescriptors
The set of files to include in the registry. Must not contain null values.
Returns
A type registry for the given files.

FromMessages

TypeRegistry FromMessages(
  params MessageDescriptor[] messageDescriptors
)

Creates a type registry from the file descriptor parents of the specified set of message descriptors.

This is a convenience overload for FromMessages(IEnumerable{MessageDescriptor}) to allow calls such as TypeRegistry.FromFiles(descriptor1, descriptor2).

Details
Parameters
messageDescriptors
The set of message descriptors to use to identify file descriptors to include in the registry. Must not contain null values.
Returns
A type registry for the given files.

FromMessages

TypeRegistry FromMessages(
  IEnumerable< MessageDescriptor > messageDescriptors
)

Creates a type registry from the file descriptor parents of the specified set of message descriptors.

The specified message descriptors are only used to identify their file descriptors; the returned registry contains all the types within the file descriptors which contain the specified message descriptors (and the dependencies of those files), not just the specified messages.

Details
Parameters
messageDescriptors
The set of message descriptors to use to identify file descriptors to include in the registry. Must not contain null values.
Returns
A type registry for the given files.