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

Public Member Functions

def __init__
 
def BuildDocument
 
def BuildMapping
 
def EndMapping
 
def BuildSequence
 
def MapTo
 
def AppendTo
 
- Public Member Functions inherited from google.appengine.api.yaml_builder.Builder
def BuildDocument
 
def InitializeDocument
 
def BuildMapping
 
def EndMapping
 
def BuildSequence
 
def EndSequence
 
def MapTo
 
def AppendTo
 

Public Attributes

 default_class
 

Detailed Description

Builder used for constructing validated objects.

Given a class that implements validation.ValidatedBase, it will parse a YAML
document and attempt to build an instance of the class.
ObjectBuilder will only map YAML fields that are accepted by the
ValidatedBase's GetValidator function.
Lists are mapped to validated.  Repeated attributes and maps are mapped to
validated.Type properties.

For a YAML map to be compatible with a class, the class must have a
constructor that can be called with no parameters.  If the provided type
does not have such a constructor a parse time error will occur.

Constructor & Destructor Documentation

def google.appengine.api.yaml_object.ObjectBuilder.__init__ (   self,
  default_class 
)
Initialize validated object builder.

Args:
  default_class: Class that is instantiated upon the detection of a new
document.  An instance of this class will act as the document itself.

Member Function Documentation

def google.appengine.api.yaml_object.ObjectBuilder.AppendTo (   self,
  subject,
  value 
)
Append a value to a sequence.

Args:
  subject: _ObjectSequence that is receiving new value.
  value: Value that is being appended to sequence.
def google.appengine.api.yaml_object.ObjectBuilder.BuildDocument (   self)
Instantiate new root validated object.

Returns:
  New instance of validated object.
def google.appengine.api.yaml_object.ObjectBuilder.BuildMapping (   self,
  top_value 
)
New instance of object mapper for opening map scope.

Args:
  top_value: Parent of nested object.

Returns:
  New instance of object mapper.
def google.appengine.api.yaml_object.ObjectBuilder.BuildSequence (   self,
  top_value 
)
New instance of object sequence.

Args:
  top_value: Object that contains the new sequence.

Returns:
  A new _ObjectSequencer instance.
def google.appengine.api.yaml_object.ObjectBuilder.EndMapping (   self,
  top_value,
  mapping 
)
When leaving scope, makes sure new object is initialized.

This method is mainly for picking up on any missing required attributes.

Args:
  top_value: Parent of closing mapping object.
  mapping: _ObjectMapper instance that is leaving scope.
def google.appengine.api.yaml_object.ObjectBuilder.MapTo (   self,
  subject,
  key,
  value 
)
Map key-value pair to an objects attribute.

Args:
  subject: _ObjectMapper of object that will receive new attribute.
  key: Key of attribute.
  value: Value of new attribute.

Raises:
  UnexpectedAttribute when the key is not a validated attribute of
  the subject value class.

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