jsonWriter method
writer writes the JSON of its class. lib/generated/container.g.dart
calls this for every @Serialize() class. The JSON encoder finds
the writer by the type of the object.
Implementation
void jsonWriter(SerializeWriter writer) {
_jsonWriters[writer.type] = writer;
forgetJsonWriters();
}