Customizing serialization | |
Object>>sixxPrepareWrite | It is called before the instance is written in SIXX. |
Object>>sixxWriteValue | Return the object actually serialized. |
Object>>sixxIgnorableInstVarNames | Specify the instance variables that are not written in SIXX |
Customizing deserialization | |
Object>>sixxInitialize | It is called immediately after the instance is read from SIXX |
Object>>sixxReadValue | Return the object for the client from the read instance. |
srs := SixxShapeChangeReadStream on: oldSixx readStream.
srs shapeChangers at:#SmallIntegerOLD put: SmallInteger . "simple renaming"
srs shapeChangers at: #SixxShapeChangedObject put: SixxMockShapeChanger.
"You can implement ShapeChanger for more complex conversion. "
Basically, you should subclass me and override three methods.
(YourShapeChanger >> shapeChangedObjectClass)
Return a newly introduced class for old instances.
(YourShapeChanger >> sixxInstVarNamed: varName put: value)
Override this method for setting converted values to the shape changed object.
Example:
"#oldNamedVar1 inst var was renamed to #renamedAtt1"
varName == #oldNamedVar1 ifTrue: [^self attributesMap at: #renamedAtt1 put: value].
"#oldNamedVar2 inst var was removed."
varName == #oldNamedVar2 ifTrue: [^self].
super sixxInstVarNamed: varName put: value
(YourShapeChanger >> initializeShapeChangedObject )
Override this method for setting newly introduced values to the shape changed object.