Public Member Functions | Protected Member Functions

Avro::Specific::SpecificDefaultWriter Class Reference

Class for writing data from any specific objects. More...

Inheritance diagram for Avro::Specific::SpecificDefaultWriter:
Avro::Generic::DefaultWriter

List of all members.

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)

Detailed Description

Class for writing data from any specific objects.


Constructor & Destructor Documentation

Avro::Specific::SpecificDefaultWriter::SpecificDefaultWriter ( Schema  schema  )  [inline]

Constructor.

Parameters:
schema schema of the object to be written

Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
us The UnionSchema to resolve against
value The value to be serialized
encoder The encoder for serialization

Reimplemented from Avro::Generic::DefaultWriter.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties