Gets or sets the method called before serialization of the object.
The method called before serialization of the object.