Class for writing data from any specific objects. More...
Public Member Functions | |
SpecificDefaultWriter (Schema schema) | |
Constructor. | |
Protected Member Functions | |
override void | WriteRecord (RecordSchema schema, object value, Encoder encoder) |
Serialized a record using the given RecordSchema. It uses GetField method to extract the field value from the given object. | |
override void | WriteFixed (FixedSchema schema, object value, Encoder encoder) |
Validates that the record is a fixed record object and that the schema in the object is the same as the given writer schema. Writes the given fixed record into the given encoder. | |
override void | WriteEnum (EnumSchema schema, object value, Encoder encoder) |
Writes the given enum value into the given encoder. | |
override void | WriteArray (ArraySchema schema, object value, Encoder encoder) |
Serialized an array. The default implementation calls EnsureArrayObject() to ascertain that the given value is an array. It then calls GetArrayLength() and GetArrayElement() to access the members of the array and then serialize them. | |
override void | WriteMap (MapSchema schema, object value, Encoder encoder) |
Writes the given map into the given encoder. | |
override void | WriteUnion (UnionSchema us, object value, Encoder encoder) |
Resolves the given value against the given UnionSchema and serializes the object against the resolved schema member. The default implementation of this method uses ResolveUnion to find the member schema within the UnionSchema. | |
override bool | Matches (Schema sc, object obj) |
Class for writing data from any specific objects.
Avro.Specific.SpecificDefaultWriter.SpecificDefaultWriter | ( | Schema | schema | ) | [inline] |
Constructor.
schema | schema of the object to be written |
override void Avro.Specific.SpecificDefaultWriter.WriteArray | ( | ArraySchema | schema, |
object | value, | ||
Encoder | encoder | ||
) | [inline, protected, virtual] |
Serialized an array. The default implementation calls EnsureArrayObject() to ascertain that the given value is an array. It then calls GetArrayLength() and GetArrayElement() to access the members of the array and then serialize them.
schema | The ArraySchema for serialization |
value | The value being serialized |
encoder | The encoder for serialization |
Reimplemented from Avro.Generic.DefaultWriter.
override void Avro.Specific.SpecificDefaultWriter.WriteEnum | ( | EnumSchema | schema, |
object | value, | ||
Encoder | encoder | ||
) | [inline, protected, virtual] |
Writes the given enum value into the given encoder.
schema | writer schema |
value | enum value |
encoder | encoder to write to |
Reimplemented from Avro.Generic.DefaultWriter.
override void Avro.Specific.SpecificDefaultWriter.WriteFixed | ( | FixedSchema | schema, |
object | value, | ||
Encoder | encoder | ||
) | [inline, protected, virtual] |
Validates that the record is a fixed record object and that the schema in the object is the same as the given writer schema. Writes the given fixed record into the given encoder.
schema | writer schema |
value | fixed object to write |
encoder | encoder to write to |
Reimplemented from Avro.Generic.DefaultWriter.
override void Avro.Specific.SpecificDefaultWriter.WriteMap | ( | MapSchema | schema, |
object | value, | ||
Encoder | encoder | ||
) | [inline, protected, virtual] |
Writes the given map into the given encoder.
schema | writer schema |
value | map to write |
encoder | encoder to write to |
Reimplemented from Avro.Generic.DefaultWriter.
override void Avro.Specific.SpecificDefaultWriter.WriteRecord | ( | RecordSchema | schema, |
object | value, | ||
Encoder | encoder | ||
) | [inline, protected, virtual] |
Serialized a record using the given RecordSchema. It uses GetField method to extract the field value from the given object.
schema | The RecordSchema to use for serialization |
value | The value to be serialized |
encoder | The Encoder for serialization |
Reimplemented from Avro.Generic.DefaultWriter.
override void Avro.Specific.SpecificDefaultWriter.WriteUnion | ( | UnionSchema | us, |
object | value, | ||
Encoder | encoder | ||
) | [inline, protected, virtual] |
Resolves the given value against the given UnionSchema and serializes the object against the resolved schema member. The default implementation of this method uses ResolveUnion to find the member schema within the UnionSchema.
us | The UnionSchema to resolve against |
value | The value to be serialized |
encoder | The encoder for serialization |
Reimplemented from Avro.Generic.DefaultWriter.