Public Member Functions | |
CodeGen () | |
Default constructor. | |
virtual void | AddProtocol (Protocol protocol) |
Adds a protocol object to generate code for. | |
virtual void | AddSchema (Schema schema) |
Adds a schema object to generate code for. | |
virtual CodeCompileUnit | GenerateCode () |
Generates code for the given protocol and schema objects. | |
virtual void | WriteCompileUnit (string outputFile) |
Writes the generated compile unit into one file. | |
virtual void | WriteTypes (string outputdir) |
Writes each types in each namespaces into individual files. | |
Static Public Member Functions | |
static Schema | getNullableType (UnionSchema schema) |
Gets the schema of a union with null. | |
Protected Member Functions | |
virtual CodeNamespace | addNamespace (string name) |
Adds a namespace object for the given name into the dictionary if it doesn't exist yet. | |
virtual void | processSchemas () |
Generates code for the schema objects. | |
virtual void | processProtocols () |
Generates code for the protocol objects. | |
virtual SchemaNames | generateNames (Protocol protocol) |
Generate list of named schemas from given protocol. | |
virtual SchemaNames | generateNames (Schema schema) |
Generate list of named schemas from given schema. | |
virtual void | addName (Schema schema, SchemaNames names) |
Recursively search the given schema for named schemas and adds them to the given container. | |
virtual void | processFixed (Schema schema) |
Creates a class declaration for fixed schema. | |
virtual void | processEnum (Schema schema) |
Creates an enum declaration. | |
virtual CodeTypeDeclaration | processRecord (Schema schema) |
Creates a class declaration. | |
virtual void | createSchemaField (Schema schema, CodeTypeDeclaration ctd, bool overrideFlag) |
Creates the static schema field for class types. | |
virtual CodeCommentStatement | createDocComment (string comment) |
Creates an XML documentation for the given comment. | |
Protected Attributes | |
Dictionary< string, CodeNamespace > | namespaceLookup = new Dictionary<string, CodeNamespace>(StringComparer.Ordinal) |
List of generated namespaces. | |
Properties | |
CodeCompileUnit | CompileUnit [get, set] |
Object that contains all the generated types. | |
IList< Schema > | Schemas [get, set] |
List of schemas to generate code for. | |
IList< Protocol > | Protocols [get, set] |
List of protocols to generate code for. |
Avro.CodeGen.CodeGen | ( | ) | [inline] |
Default constructor.
virtual void Avro.CodeGen.addName | ( | Schema | schema, |
SchemaNames | names | ||
) | [inline, protected, virtual] |
Recursively search the given schema for named schemas and adds them to the given container.
schema | schema object to search |
names | list of named schemas |
virtual CodeNamespace Avro.CodeGen.addNamespace | ( | string | name | ) | [inline, protected, virtual] |
Adds a namespace object for the given name into the dictionary if it doesn't exist yet.
name | name of namespace |
virtual void Avro.CodeGen.AddProtocol | ( | Protocol | protocol | ) | [inline, virtual] |
Adds a protocol object to generate code for.
protocol | protocol object |
virtual void Avro.CodeGen.AddSchema | ( | Schema | schema | ) | [inline, virtual] |
Adds a schema object to generate code for.
schema | schema object |
virtual CodeCommentStatement Avro.CodeGen.createDocComment | ( | string | comment | ) | [inline, protected, virtual] |
Creates an XML documentation for the given comment.
comment | comment |
virtual void Avro.CodeGen.createSchemaField | ( | Schema | schema, |
CodeTypeDeclaration | ctd, | ||
bool | overrideFlag | ||
) | [inline, protected, virtual] |
Creates the static schema field for class types.
schema | schema |
ctd | CodeTypeDeclaration for the class |
virtual CodeCompileUnit Avro.CodeGen.GenerateCode | ( | ) | [inline, virtual] |
Generates code for the given protocol and schema objects.
virtual SchemaNames Avro.CodeGen.generateNames | ( | Protocol | protocol | ) | [inline, protected, virtual] |
Generate list of named schemas from given protocol.
protocol | protocol to process |
virtual SchemaNames Avro.CodeGen.generateNames | ( | Schema | schema | ) | [inline, protected, virtual] |
Generate list of named schemas from given schema.
schema | schema to process |
static Schema Avro.CodeGen.getNullableType | ( | UnionSchema | schema | ) | [inline, static] |
Gets the schema of a union with null.
schema | union schema |
virtual void Avro.CodeGen.processEnum | ( | Schema | schema | ) | [inline, protected, virtual] |
Creates an enum declaration.
schema | enum schema |
ns | namespace |
virtual void Avro.CodeGen.processFixed | ( | Schema | schema | ) | [inline, protected, virtual] |
Creates a class declaration for fixed schema.
schema | fixed schema |
ns | namespace object |
virtual void Avro.CodeGen.processProtocols | ( | ) | [inline, protected, virtual] |
Generates code for the protocol objects.
virtual CodeTypeDeclaration Avro.CodeGen.processRecord | ( | Schema | schema | ) | [inline, protected, virtual] |
Creates a class declaration.
schema | record schema |
ns | namespace |
virtual void Avro.CodeGen.processSchemas | ( | ) | [inline, protected, virtual] |
Generates code for the schema objects.
virtual void Avro.CodeGen.WriteCompileUnit | ( | string | outputFile | ) | [inline, virtual] |
Writes the generated compile unit into one file.
outputFile | name of output file to write to |
virtual void Avro.CodeGen.WriteTypes | ( | string | outputdir | ) | [inline, virtual] |
Writes each types in each namespaces into individual files.
outputdir | name of directory to write to |
Dictionary<string, CodeNamespace> Avro.CodeGen.namespaceLookup = new Dictionary<string, CodeNamespace>(StringComparer.Ordinal) [protected] |
List of generated namespaces.
CodeCompileUnit Avro.CodeGen.CompileUnit [get, set] |
Object that contains all the generated types.
IList<Protocol> Avro.CodeGen.Protocols [get, set] |
List of protocols to generate code for.
IList<Schema> Avro.CodeGen.Schemas [get, set] |
List of schemas to generate code for.