#  google.protobuf.reflection  ¶

Contains a metaclass and helper functions used to create protocol message
classes from Descriptor objects at runtime.

Recall that a metaclass is the “type” of a class. (A class is to a metaclass
what an instance is to a class.)

In this case, we use the GeneratedProtocolMessageType metaclass to inject all
the useful functionality into the classes output by the protocol compiler at
compile-time.

The upshot of all this is that the real implementation details for ALL pure-
Python protocol buffers are _here in this file_ .

` google.protobuf.reflection. ` ` MakeClass ` (  _descriptor_ )  ¶

    

Construct a class object for a protobuf described by descriptor.

DEPRECATED: use MessageFactory.GetPrototype() instead.

Parameters  :

    

**descriptor** – A descriptor.Descriptor object describing the protobuf.

Returns  :

    

The Message class object described by the descriptor.

` google.protobuf.reflection. ` ` ParseMessage ` (  _descriptor_ , _byte_str_
)  ¶

    

Generate a new Message instance from this Descriptor and a byte string.

DEPRECATED: ParseMessage is deprecated because it is using MakeClass(). Please
use MessageFactory.GetPrototype() instead.

Parameters  :

    

  * **descriptor** – Protobuf Descriptor object 

  * **byte_str** – Serialized protocol buffer byte string 

Returns  :

    

Newly created protobuf Message object.

###  [ Table of Contents ](../../index.html)

  * [ google.protobuf ](../protobuf.html)
  * [ google.protobuf.any_pb2 ](any_pb2.html)
  * [ google.protobuf.descriptor ](descriptor.html)
  * [ google.protobuf.descriptor_database ](descriptor_database.html)
  * [ google.protobuf.descriptor_pb2 ](descriptor_pb2.html)
  * [ google.protobuf.descriptor_pool ](descriptor_pool.html)
  * [ google.protobuf.duration_pb2 ](duration_pb2.html)
  * [ google.protobuf.empty_pb2 ](empty_pb2.html)
  * [ google.protobuf.field_mask_pb2 ](field_mask_pb2.html)
  * [ google.protobuf.internal.containers ](internal/containers.html)
  * [ google.protobuf.json_format ](json_format.html)
  * [ google.protobuf.message ](message.html)
  * [ google.protobuf.message_factory ](message_factory.html)
  * [ google.protobuf.proto_builder ](proto_builder.html)
  * google.protobuf.reflection 
  * [ google.protobuf.service ](service.html)
  * [ google.protobuf.service_reflection ](service_reflection.html)
  * [ google.protobuf.struct_pb2 ](struct_pb2.html)
  * [ google.protobuf.symbol_database ](symbol_database.html)
  * [ google.protobuf.text_encoding ](text_encoding.html)
  * [ google.protobuf.text_format ](text_format.html)
  * [ google.protobuf.timestamp_pb2 ](timestamp_pb2.html)
  * [ google.protobuf.type_pb2 ](type_pb2.html)
  * [ google.protobuf.unknown_fields ](unknown_fields.html)
  * [ google.protobuf.wrappers_pb2 ](wrappers_pb2.html)

###  Related Topics

  * [ Documentation overview ](../../index.html)
    * Previous: [ google.protobuf.proto_builder ](proto_builder.html "previous chapter")
    * Next: [ google.protobuf.service ](service.html "next chapter")

###  This Page

  * [ Show Source ](../../_sources/google/protobuf/reflection.rst.txt)

©2008, Google LLC. | Powered by [ Sphinx 2.3.1 ](http://sphinx-doc.org/) & [ Alabaster 0.7.12 ](https://github.com/bitprophet/alabaster) | [ Page source ](../../_sources/google/protobuf/reflection.rst.txt)