proto2.Descriptor Extends
A class which describes a Protocol Buffer 2 Message.

Inheritance

Constructor

goog.proto2.Descriptor(messageTypemetadatafields)

Parameters

messageType : function(new:goog.proto2.Message)
Constructor for the message class that this descriptor describes.
metadata : !goog.proto2.Metadata
The metadata about the message that will be used to construct this descriptor.
fields : Array.<!goog.proto2.FieldDescriptor>
The fields of the message described by this descriptor.

Instance Methods

Public Protected Private
createMessageInstance() !goog.proto2.Message
Creates an instance of the message type that this descriptor describes.
Returns: !goog.proto2.Message  The instance of the message.
code »
findFieldByName(name) goog.proto2.FieldDescriptor
Returns the field matching the given name, if any. Note that this method searches over the *original* name of the field, not the camelCase version.
Arguments:
name : string
The field name for which to search.
Returns: goog.proto2.FieldDescriptor  The field found, if any.
code »
findFieldByTag(tag) goog.proto2.FieldDescriptor
Returns the field matching the given tag number, if any.
Arguments:
tag : number | string
The field tag number for which to search.
Returns: goog.proto2.FieldDescriptor  The field found, if any.
code »
getContainingType() goog.proto2.Descriptor
Returns the descriptor of the containing message type or null if none.
Returns: goog.proto2.Descriptor  The descriptor.
code »
getFields() !Array.<!goog.proto2.FieldDescriptor>
Returns the fields in the message described by this descriptor ordered by tag.
Returns: !Array.<!goog.proto2.FieldDescriptor>  The array of field descriptors.
code »
getFieldsMap() !Object.<number, !goog.proto2.FieldDescriptor>
Returns the fields in the message as a key/value map, where the key is the tag number of the field. DO NOT MODIFY THE RETURNED OBJECT. We return the actual, internal, fields map for performance reasons, and changing the map can result in undefined behavior of this library.
Returns: !Object.<number, !goog.proto2.FieldDescriptor>  The field map.
code »
getFullName() ?string
Returns the full name of the message, if any.
Returns: ?string  The name.
code »
getName() ?string
Returns the name of the message, if any.
Returns: ?string  The name.
code »

Instance Properties

containingType_ : goog.proto2.Message
No description.
Code »
fields_ :
The fields of the message described by this descriptor.
Code »
fullName_ :
No description.
Code »
messageType_ :
No description.
Code »
name_ :
No description.
Code »

Package proto2

Package Reference