| The ElementSerializerFactory class provides a mechanism to provide the
correct implementation of an ElementSerializer for a given ElementDefinition.
This should be the only method used to instantiate an ElementSerializer. The
LegacyDataSerializer contains an instance of this class that is first called
by its serialize method. Each implementation of ElementSerializer will also
call this if it needs to recursively serialize any child elements. Instead of
creating new instances of the different ElementSerializers each time an
element is serialized, the ElementSerializerFactory should maintain an
instance of each type of ElementSerializer and reuse it.
|