Package google :: Package protobuf :: Module text_format :: Class _Parser
[hide private]
[frames] | no frames]

Class _Parser

source code

object --+
         |
        _Parser

Text format parser for protocol message.

Instance Methods [hide private]
 
__init__(self, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
ParseLines(self, lines, message)
Parses a text representation of a protocol message into a message.
source code
 
MergeLines(self, lines, message)
Merges a text representation of a protocol message into a message.
source code
 
_ParseOrMerge(self, lines, message)
Converts a text representation of a protocol message into a message.
source code
 
_MergeField(self, tokenizer, message)
Merges a single protocol message field into a message.
source code
 
_ConsumeAnyTypeUrl(self, tokenizer)
Consumes a google.protobuf.Any type URL and returns the type name.
source code
 
_MergeMessageField(self, tokenizer, message, field)
Merges a single scalar field into a message.
source code
 
_MergeScalarField(self, tokenizer, message, field)
Merges a single scalar field into a message.
source code

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

Static Methods [hide private]
 
_IsProto3Syntax(message) source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, allow_unknown_extension=False, allow_field_number=False, descriptor_pool=None, allow_unknown_field=False)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

_ParseOrMerge(self, lines, message)

source code 
Converts a text representation of a protocol message into a message.

Args:
  lines: Lines of a message's text representation.
  message: A protocol buffer message to merge into.

Raises:
  ParseError: On text parsing problems.

_MergeField(self, tokenizer, message)

source code 
Merges a single protocol message field into a message.

Args:
  tokenizer: A tokenizer to parse the field name and values.
  message: A protocol message to record the data.

Raises:
  ParseError: In case of text parsing problems.

_MergeMessageField(self, tokenizer, message, field)

source code 
Merges a single scalar field into a message.

Args:
  tokenizer: A tokenizer to parse the field value.
  message: The message of which field is a member.
  field: The descriptor of the field to be merged.

Raises:
  ParseError: In case of text parsing problems.

_MergeScalarField(self, tokenizer, message, field)

source code 
Merges a single scalar field into a message.

Args:
  tokenizer: A tokenizer to parse the field value.
  message: A protocol message to record the data.
  field: The descriptor of the field to be merged.

Raises:
  ParseError: In case of text parsing problems.
  RuntimeError: On runtime errors.