schema_salad.dotnet_codegen
DotNet code generator for a given schema salad definition.
Attributes
Classes
Generation of TypeScript code for a given Schema Salad definition. |
Functions
|
Generate a documentation string from a schema salad doc field. |
Module Contents
- schema_salad.dotnet_codegen.doc_to_doc_string(doc, indent_level=0)
Generate a documentation string from a schema salad doc field.
- schema_salad.dotnet_codegen.prims
- class schema_salad.dotnet_codegen.DotNetCodeGen(base, examples, target, package)
Bases:
digraph inheritancee100b2d656 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CodeGenBase" [URL="../codegen_base/index.html#schema_salad.codegen_base.CodeGenBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Abstract base class for schema salad code generators."]; "DotNetCodeGen" [URL="#schema_salad.dotnet_codegen.DotNetCodeGen",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generation of TypeScript code for a given Schema Salad definition."]; "CodeGenBase" -> "DotNetCodeGen" [arrowsize=0.5,style="setlinewidth(0.5)"]; }schema_salad.codegen_base.CodeGenBase
Generation of TypeScript code for a given Schema Salad definition.
- target_dir
- main_src_dir
- test_src_dir
- test_resources_dir
- package
- base_uri
- examples
- prologue()
Trigger to generate the prolouge code.
- Return type:
None
- static safe_name(name)
Generate a safe version of the given name.
- begin_class(classname, extends, doc, abstract, field_names, idfield, optional_fields)
Produce the header for the given class.
- Parameters:
classname (str)
extends (collections.abc.MutableSequence[str])
doc (str)
abstract (bool)
field_names (collections.abc.MutableSequence[str])
idfield (str)
- Return type:
None
- end_class(classname, field_names)
Signal that we are done with this class.
- type_loader(type_declaration, container=None, no_link_check=None)
Parse the given type declaration and declare its components.
- type_loader_enum(type_declaration)
Build an enum type loader for the given declaration.
- Parameters:
- Return type:
- declare_field(name, fieldtype, doc, optional, subscope)
Output the code to load the given field.
- Parameters:
name (str)
fieldtype (schema_salad.codegen_base.TypeDef)
doc (Optional[str])
optional (bool)
subscope (Optional[str])
- Return type:
None
- declare_id_field(name, fieldtype, doc, optional)
Output the code to handle the given ID field.
- Parameters:
name (str)
fieldtype (schema_salad.codegen_base.TypeDef)
doc (Optional[str])
optional (bool)
- Return type:
None
- to_dotnet(val)
Convert a Python keyword to a DotNet keyword.
- Parameters:
val (Any)
- Return type:
Any
- uri_loader(inner, scoped_id, vocab_term, ref_scope, no_link_check=None)
Construct the TypeDef for the given URI loader.
- idmap_loader(field, inner, map_subject, map_predicate)
Construct the TypeDef for the given mapped ID loader.
- typedsl_loader(inner, ref_scope)
Construct the TypeDef for the given DSL loader.
- Parameters:
ref_scope (Optional[int])
- Return type:
- epilogue(root_loader)
Trigger to generate the epilouge code.
- Parameters:
root_loader (schema_salad.codegen_base.TypeDef)
- Return type:
None
- secondaryfilesdsl_loader(inner)
Construct the TypeDef for secondary files.
- Parameters:
- Return type: