class documentation

class _SchemaToStruct(object):

Constructor: _SchemaToStruct(schema, seen, dent)

View In Hierarchy

Convert schema to a prototype object.

Method __init__ Constructor.
Method emit Add text as a line to the output.
Method emitBegin Add text to the output, but with no line terminator.
Method emitEnd Add text and comment to the output with line terminator.
Method indent Increase indentation level.
Method to_str Prototype object based on the schema, in Python code with comments.
Method undent Decrease indentation level.
Instance Variable dent Undocumented
Instance Variable from_cache Undocumented
Instance Variable schema Undocumented
Instance Variable seen Undocumented
Instance Variable string Undocumented
Instance Variable value Undocumented
Method _to_str_impl Prototype object based on the schema, in Python code with comments.
@util.positional(3)
def __init__(self, schema, seen, dent=0):

Constructor.

Parameters
schemaobject, Parsed JSON schema.
seenlist, List of names of schema already seen while parsing. Used to handle recursive definitions.
dentint, Initial indentation depth.
def emit(self, text):

Add text as a line to the output.

Parameters
textstring, Text to output.
def emitBegin(self, text):

Add text to the output, but with no line terminator.

Parameters
textstring, Text to output.
def emitEnd(self, text, comment):

Add text and comment to the output with line terminator.

Parameters
textstring, Text to output.
commentstring, Python comment.
def indent(self):

Increase indentation level.

def to_str(self, from_cache):

Prototype object based on the schema, in Python code with comments.

Parameters
from_cachecallable(name, seen), Callable that retrieves an object prototype for a schema with the given name. Seen is a list of schema names already seen as we recursively descend the schema definition.
Returns
Prototype object based on the schema, in Python code with comments. The lines of the code will all be properly indented.
def undent(self):

Decrease indentation level.

dent =

Undocumented

from_cache =

Undocumented

schema =

Undocumented

seen =

Undocumented

string =

Undocumented

value: list =

Undocumented

def _to_str_impl(self, schema):

Prototype object based on the schema, in Python code with comments.

Parameters
schemaobject, Parsed JSON schema file.
Returns
Prototype object based on the schema, in Python code with comments.