proto2.FieldDescriptor Extends
A class which describes a field in a Protocol Buffer 2 Message.

Inheritance

Constructor

goog.proto2.FieldDescriptor(messageTypetagmetadata)

Parameters

messageType : Function
Constructor for the message class to which the field described by this class belongs.
tag : number | string
The field's tag index.
metadata : Object
The metadata about this field that will be used to construct this descriptor.

Instance Methods

Public Protected Private
deserializationConversionPermitted() boolean
Returns true if simple conversions between numbers and strings are permitted during deserialization for this field.
Returns: boolean  Whether conversion is permitted.
code »
getContainingType() goog.proto2.Descriptor
Returns the descriptor describing the message that defined this field.
Returns: goog.proto2.Descriptor  The descriptor.
code »
getDefaultValue() *
Returns the default value of this field.
Returns: *  The default value.
code »
getFieldMessageType() goog.proto2.Descriptor
Returns the descriptor of the message type of this field. Only valid for fields of type GROUP and MESSAGE.
Returns: goog.proto2.Descriptor  The message descriptor.
code »
getFieldType() goog.proto2.FieldDescriptor.FieldType
Returns the field type of the field described by this descriptor.
Returns: goog.proto2.FieldDescriptor.FieldType  The field type.
code »
getName() string
Returns the name of the field that this descriptor represents.
Returns: string  The name.
code »
getNativeType() Object
Returns the native (i.e. ECMAScript) type of the field described by this descriptor.
Returns: Object  The native type.
code »
getTag() number
Returns the tag of the field that this descriptor represents.
Returns: number  The tag number.
code »
isCompositeType() boolean
No description.
Returns: boolean  True if the field stores composite data or repeated composite data (message or group).
code »
isOptional() boolean
Returns whether the field described by this descriptor is optional.
Returns: boolean  Whether the field is optional.
code »
isRepeated() boolean
Returns whether the field described by this descriptor is repeating.
Returns: boolean  Whether the field is repeated.
code »
isRequired() boolean
Returns whether the field described by this descriptor is required.
Returns: boolean  Whether the field is required.
code »

Instance Properties

defaultValue_ :
The default value of this field, if different from the default, default value.
Code »
deserializationConversionPermitted_ :
Is it permissible on deserialization to convert between numbers and well-formed strings? Is true for 64-bit integral field types, false for all other field types.
Code »
fieldType_ :
The field type of this field.
Code »
isRepeated_ :
If true, this field is a repeating field.
Code »
isRequired_ :
If true, this field is required.
Code »
name_ :
The field's name.
Code »
nativeType_ :
If this field is a primitive: The native (ECMAScript) type of this field. If an enumeration: The enumeration object. If a message or group field: The Message function.
Code »
parent_ :
The message type that contains the field that this descriptor describes.
Code »
tag_ :
The field's tag number.
Code »

Enumerations

goog.proto2.FieldDescriptor.FieldType :
An enumeration defining the possible field types. Should be a mirror of that defined in descriptor.h.
Constants:
BOOL
No description.
BYTES
No description.
DOUBLE
No description.
ENUM
No description.
FIXED32
No description.
FIXED64
No description.
FLOAT
No description.
GROUP
No description.
INT32
No description.
INT64
No description.
MESSAGE
No description.
SFIXED32
No description.
SFIXED64
No description.
SINT32
No description.
SINT64
No description.
STRING
No description.
UINT32
No description.
UINT64
No description.
Code »

Package proto2

Package Reference