Package google :: Package protobuf :: Module descriptor_pb2 :: Class MessageOptions
[frames] | no frames]

Class MessageOptions

source code

     object --+    
              |    
message.Message --+
                  |
                 MessageOptions

Nested Classes
  __metaclass__
Metaclass for protocol message classes created at runtime from Descriptors.
Instance Methods
 
ByteSize(self)
Returns the serialized size of this message.
 
Clear(self)
Clears all data that was set in the message.
 
ClearExtension(self, extension_handle)
 
ClearField(self, field_name)
Clears the contents of a given field, or the field set inside a oneof group.
 
FindInitializationErrors(self)
Finds required fields which are not initialized.
 
HasExtension(self, extension_handle)
 
HasField(self, field_name)
Checks if a certain field is set for the message.
 
IsInitialized(self, errors=None)
Checks if all required fields of a message are set.
 
ListFields(self)
Returns a list of (FieldDescriptor, value) tuples for all fields in the message which are not empty.
 
MergeFrom(self, msg)
Merges the contents of the specified message into current message.
 
MergeFromString(self, serialized)
Merges serialized protocol buffer data into this message.
 
SerializePartialToString(self)
Serializes the protocol message to a binary string.
 
SerializeToString(self)
Serializes the protocol message to a binary string.
 
SetInParent(self)
Sets the _cached_byte_size_dirty bit to true, and propagates this to our listener iff this was a state change.
 
__eq__(self, other)
Recursively compares two messages by value and structure.
 
__init__(self, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__str__(self)
Outputs a human-readable representation of the message.
 
__unicode__(self)
Outputs a human-readable representation of the message.

Inherited from message.Message: CopyFrom, DiscardUnknownFields, ParseFromString, WhichOneof, __deepcopy__, __getstate__, __hash__, __ne__, __setstate__

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Static Methods
 
FromString(s) source code
 
RegisterExtension(extension_handle) source code
Class Variables
  DESCRIPTOR = _descriptor.Descriptor(name= 'MessageOptions', fu...
  MESSAGE_SET_WIRE_FORMAT_FIELD_NUMBER = 1
  NO_STANDARD_DESCRIPTOR_ACCESSOR_FIELD_NUMBER = 2
  UNINTERPRETED_OPTION_FIELD_NUMBER = 999
Properties
  Extensions
  message_set_wire_format
Magic attribute generated for "message_set_wire_format" proto field.
  no_standard_descriptor_accessor
Magic attribute generated for "no_standard_descriptor_accessor" proto field.
  uninterpreted_option
Magic attribute generated for "uninterpreted_option" proto field.

Inherited from object: __class__

Method Details

ByteSize(self)

 

Returns the serialized size of this message. Recursively calls ByteSize() on all contained messages.

Overrides: message.Message.ByteSize
(inherited documentation)

Clear(self)

 

Clears all data that was set in the message.

Overrides: message.Message.Clear
(inherited documentation)

ClearExtension(self, extension_handle)

 
Overrides: message.Message.ClearExtension

ClearField(self, field_name)

 

Clears the contents of a given field, or the field set inside a oneof group. If the name neither refers to a defined field or oneof group, ValueError is raised.

Overrides: message.Message.ClearField
(inherited documentation)

FindInitializationErrors(self)

 
Finds required fields which are not initialized.

Returns:
  A list of strings.  Each string is a path to an uninitialized field from
  the top-level message, e.g. "foo.bar[5].baz".

HasExtension(self, extension_handle)

 
Overrides: message.Message.HasExtension

HasField(self, field_name)

 

Checks if a certain field is set for the message. Note if the field_name is not defined in the message descriptor, ValueError will be raised.

Overrides: message.Message.HasField
(inherited documentation)

IsInitialized(self, errors=None)

 
Checks if all required fields of a message are set.

Args:
  errors:  A list which, if provided, will be populated with the field
           paths of all missing required fields.

Returns:
  True iff the specified message has all required fields set.

Overrides: message.Message.IsInitialized

ListFields(self)

 

Returns a list of (FieldDescriptor, value) tuples for all fields in the message which are not empty. A singular field is non-empty if HasField() would return true, and a repeated field is non-empty if it contains at least one element. The fields are ordered by field number

Overrides: message.Message.ListFields
(inherited documentation)

MergeFrom(self, msg)

 
Merges the contents of the specified message into current message.

This method merges the contents of the specified message into the current
message. Singular fields that are set in the specified message overwrite
the corresponding fields in the current message. Repeated fields are
appended. Singular sub-messages and groups are recursively merged.

Args:
  other_msg: Message to merge into the current message.

Overrides: message.Message.MergeFrom
(inherited documentation)

MergeFromString(self, serialized)

 
Merges serialized protocol buffer data into this message.

When we find a field in |serialized| that is already present
in this message:
  - If it's a "repeated" field, we append to the end of our list.
  - Else, if it's a scalar, we overwrite our field.
  - Else, (it's a nonrepeated composite), we recursively merge
    into the existing composite.

TODO(robinson): Document handling of unknown fields.

Args:
  serialized: Any object that allows us to call buffer(serialized)
    to access a string of bytes using the buffer interface.

TODO(robinson): When we switch to a helper, this will return None.

Returns:
  The number of bytes read from |serialized|.
  For non-group messages, this will always be len(serialized),
  but for messages which are actually groups, this will
  generally be less than len(serialized), since we must
  stop when we reach an END_GROUP tag.  Note that if
  we *do* stop because of an END_GROUP tag, the number
  of bytes returned does not include the bytes
  for the END_GROUP tag information.

Overrides: message.Message.MergeFromString
(inherited documentation)

SerializePartialToString(self)

 
Serializes the protocol message to a binary string.

This method is similar to SerializeToString but doesn't check if the
message is initialized.

Returns:
  A string representation of the partial message.

Overrides: message.Message.SerializePartialToString
(inherited documentation)

SerializeToString(self)

 
Serializes the protocol message to a binary string.

Returns:
  A binary string representation of the message if all of the required
  fields in the message are set (i.e. the message is initialized).

Raises:
  message.EncodeError if the message isn't initialized.

Overrides: message.Message.SerializeToString
(inherited documentation)

SetInParent(self)

 

Sets the _cached_byte_size_dirty bit to true, and propagates this to our listener iff this was a state change.

Overrides: message.Message.SetInParent

__eq__(self, other)
(Equality operator)

 

Recursively compares two messages by value and structure.

Overrides: message.Message.__eq__
(inherited documentation)

__init__(self, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

Outputs a human-readable representation of the message.

Overrides: object.__str__
(inherited documentation)

__unicode__(self)

 

Outputs a human-readable representation of the message.

Overrides: message.Message.__unicode__
(inherited documentation)

Class Variable Details

DESCRIPTOR

Value:
_descriptor.Descriptor(name= 'MessageOptions', full_name= 'google.prot\
obuf.MessageOptions', filename= None, file= DESCRIPTOR, containing_typ\
e= None, fields= [_descriptor.FieldDescriptor(name= 'message_set_wire_\
format', full_name= 'google.protobuf.MessageOptions.message_set_wire_f\
ormat', index= 0, number= 1, type= 8, cpp_type= 7, label= 1, has_defau\
lt_value= True, default_value= False, message_type= None, enum_type= N\
one, containing_type= None, is_extension= False, extension_scope= None\
, options= None), _descriptor.FieldDescriptor(name= 'no_standard_descr\
...

Property Details

Extensions

Get Method:
unreachable(self)

message_set_wire_format

Magic attribute generated for "message_set_wire_format" proto field.

Get Method:
unreachable.getter(self) - Getter for message_set_wire_format.
Set Method:
unreachable.setter(self, new_value) - Setter for message_set_wire_format.

no_standard_descriptor_accessor

Magic attribute generated for "no_standard_descriptor_accessor" proto field.

Get Method:
unreachable.getter(self) - Getter for no_standard_descriptor_accessor.
Set Method:
unreachable.setter(self, new_value) - Setter for no_standard_descriptor_accessor.

uninterpreted_option

Magic attribute generated for "uninterpreted_option" proto field.

Get Method:
unreachable.getter(self) - Getter for uninterpreted_option.
Set Method:
unreachable.setter(self, new_value)