proto2.ObjectSerializer Extends goog.proto2.Serializer
ObjectSerializer, a serializer which turns Messages into simplified ECMAScript objects.

Inheritance

Constructor

goog.proto2.ObjectSerializer(opt_keyOption)

Parameters

opt_keyOption : goog.proto2.ObjectSerializer.KeyOption=
If specified, which key option to use when serializing/deserializing.

Instance Methods

Public Protected Private
deserializeTo(messagedata)
Deserializes a message from an object 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 »
serialize(message) !Object
Serializes a message to an object.
Arguments:
message : goog.proto2.Message
The message to be serialized.
Returns: !Object  The serialized form of the message.
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 »
keyOption_ :
No description.
Code »

Static Properties

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

Enumerations

goog.proto2.ObjectSerializer.KeyOption :
An enumeration of the options for how to emit the keys in the generated simplified object.
Constants:
NAME
No description.
TAG
No description.
Code »

Package proto2

Package Reference