proto2.TextFormatSerializer Extends goog.proto2.Serializer
TextFormatSerializer, a serializer which turns Messages into the human readable text format.

Inheritance

Constructor

goog.proto2.TextFormatSerializer(opt_ignoreMissingFieldsopt_useEnumValues)

Parameters

opt_ignoreMissingFields : boolean=
If true, then fields that cannot be found on the proto when parsing the text format will be ignored.
opt_useEnumValues : boolean=
If true, serialization code for enums will use enum integer values instead of human-readable symbolic names.

Instance Methods

Public Protected Private
deserializeTo(messagedata) ?string
Deserializes a message from text format and places the data in the message.
Arguments:
message : goog.proto2.Message
The message in which to place the information.
data : *
The text format data.
Returns: ?string  The parse error or null on success.
code »
printFieldValue_(valuefieldprinter)
Prints the serialized value for the given field to the printer.
Arguments:
value : *
The field's value.
field : goog.proto2.FieldDescriptor
The field whose value is being printed.
printer : goog.proto2.TextFormatSerializer.Printer_
The printer to which the value will be printed.
code »
printField_(messagefieldprinter)
Prints the serialized field to the printer.
Arguments:
message : goog.proto2.Message
The parent message.
field : goog.proto2.FieldDescriptor
The field to print.
printer : goog.proto2.TextFormatSerializer.Printer_
The printer to which the field will be printed.
code »
serialize(message) string
Serializes a message to a string.
Arguments:
message : goog.proto2.Message
The message to be serialized.
Returns: string  The serialized form of the message.
code »
serializeMessage_(messageprinter)
Serializes the message and prints the text form into the given printer.
Arguments:
message : goog.proto2.Message
The message to serialize.
printer : goog.proto2.TextFormatSerializer.Printer_
The printer to which the text format will be printed.
code »
serializeUnknown_(tagvalueprinter)
Serializes an unknown field. When parsed from the JsPb object format, this manifests as either a primitive type, an array, or a raw object with integer keys. There is no descriptor available to interpret the types of nested messages.
Arguments:
tag : number
The tag for the field. Since it's unknown, this is a number rather than a string.
value : *
The value of the field.
printer : !goog.proto2.TextFormatSerializer.Printer_
The printer to which the text format will be serialized.
code »
deserialize(descriptordata) !goog.proto2.Message
Deserializes a message from the expected format.
Arguments:
descriptor : goog.proto2.Descriptor
The descriptor of the message to be created.
data : *
The data of the message.
Returns: !goog.proto2.Message  The message created.
code »
deserializeTo(messagedata)
Deserializes a message from the expected format and places the data in the message.
Arguments:
message : goog.proto2.Message
The message in which to place the information.
data : *
The data of the message.
code »
getDeserializedValue(fieldvalue) *
Returns the deserialized form of the given value for the given field if the field is a Message or Group and returns the value, converted or unchanged, for primitive field types otherwise.
Arguments:
field : goog.proto2.FieldDescriptor
The field from which this value came.
value : *
The value of the field.
Returns: *  The value.
code »
getSerializedValue(fieldvalue) *
Returns the serialized form of the given value for the given field if the field is a Message or Group and returns the value unchanged otherwise.
Arguments:
field : goog.proto2.FieldDescriptor
The field from which this value came.
value : *
The value of the field.
Returns: *  The value.
code »
serialize(message) *
Serializes a message to the expected format.
Arguments:
message : goog.proto2.Message
The message to be serialized.
Returns: *  The serialized form of the message.
code »

Instance Properties

constructor :
No description.
Code »
ignoreMissingFields_ :
Whether to ignore fields not defined on the proto when parsing the text format.
Code »
useEnumValues_ :
Whether to use integer enum values during enum serialization. If false, symbolic names will be used.
Code »

Static Properties

goog.proto2.TextFormatSerializer.superClass_ :
No description.
Code »

Package proto2

Package Reference