App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.api.yaml_builder.Builder Class Reference
Inheritance diagram for google.appengine.api.yaml_builder.Builder:
google.appengine.api.yaml_object.ObjectBuilder

Public Member Functions

def BuildDocument
 
def InitializeDocument
 
def BuildMapping
 
def EndMapping
 
def BuildSequence
 
def EndSequence
 
def MapTo
 
def AppendTo
 

Detailed Description

Interface for building documents and type from YAML events.

Implement this interface to create a new builder.  Builders are
passed to the BuilderHandler and used as a factory and assembler
for creating concrete representations of YAML files.

Member Function Documentation

def google.appengine.api.yaml_builder.Builder.AppendTo (   self,
  subject,
  value 
)
Append value to a sequence representation.

Implementation is defined by sub-class of Builder.

Args:
  subject: Object that represents sequence.  Value returned from
BuildSequence
  value: Value to be appended to subject.  Can be any kind of value.
def google.appengine.api.yaml_builder.Builder.BuildDocument (   self)
Build new document.

The object built by this method becomes the top level entity
that the builder handler constructs.  The actual type is
determined by the sub-class of the Builder class and can essentially
be any type at all.  This method is always called when the parser
encounters the start of a new document.

Returns:
  New object instance representing concrete document which is
  returned to user via BuilderHandler.GetResults().
def google.appengine.api.yaml_builder.Builder.BuildMapping (   self,
  top_value 
)
Build a new mapping representation.

Called when StartMapping event received.  Type of object is determined
by Builder sub-class.

Args:
  top_value: Object which will be new mappings parant.  Will be object
returned from previous call to BuildMapping or BuildSequence.

Returns:
  Instance of new object that represents a mapping type in target model.
def google.appengine.api.yaml_builder.Builder.BuildSequence (   self,
  top_value 
)
Build a new sequence representation.

Called when StartSequence event received.  Type of object is determined
by Builder sub-class.

Args:
  top_value: Object which will be new sequences parant.  Will be object
returned from previous call to BuildMapping or BuildSequence.

Returns:
  Instance of new object that represents a sequence type in target model.
def google.appengine.api.yaml_builder.Builder.EndMapping (   self,
  top_value,
  mapping 
)
Previously constructed mapping scope is at an end.

Called when the end of a mapping block is encountered.  Useful for
additional clean up or end of scope validation.

Args:
  top_value: Value which is parent of the mapping.
  mapping: Mapping which is at the end of its scope.
def google.appengine.api.yaml_builder.Builder.EndSequence (   self,
  top_value,
  sequence 
)
Previously constructed sequence scope is at an end.

Called when the end of a sequence block is encountered.  Useful for
additional clean up or end of scope validation.

Args:
  top_value: Value which is parent of the sequence.
  sequence: Sequence which is at the end of its scope.
def google.appengine.api.yaml_builder.Builder.InitializeDocument (   self,
  document,
  value 
)
Initialize document with value from top level of document.

This method is called when the root document element is encountered at
the top level of a YAML document.  It should get called immediately
after BuildDocument.

Receiving the None value indicates the empty document.

Args:
  document: Document as constructed in BuildDocument.
  value: Scalar value to initialize the document with.
def google.appengine.api.yaml_builder.Builder.MapTo (   self,
  subject,
  key,
  value 
)
Map value to a mapping representation.

Implementation is defined by sub-class of Builder.

Args:
  subject: Object that represents mapping.  Value returned from
BuildMapping.
  key: Key used to map value to subject.  Can be any scalar value.
  value: Value which is mapped to subject. Can be any kind of value.

The documentation for this class was generated from the following file: