Customizing serialization | |
Object>>sixxNonReferencableInstVarNames | Specify the instance variables that should not be referenced in SIXX. Values are always written redundantly. It is useful for small literal objects like String, Number, etc. |
Object>>sixxReferenceIdInContext: | Return unique id that can be referenced from other objects in SIXX. It is useful when objects have their own unique id. |
array := #(1 2 3 4 5).
array sixxString. "print it"
'<sixx.object sixx.id="0" sixx.type="Array" >
<sixx.object sixx.id="1" sixx.type="SmallInteger" >1</sixx.object>
<sixx.object sixx.id="2" sixx.type="SmallInteger" >2</sixx.object>
<sixx.object sixx.id="3" sixx.type="SmallInteger" >3</sixx.object>
<sixx.object sixx.id="4" sixx.type="SmallInteger" >4</sixx.object>
<sixx.object sixx.id="5" sixx.type="SmallInteger" >5</sixx.object>
</sixx.object>'
SixxContext formatters: {SixxMockLiteralArrayFormatter on: Array}.
'<sixx.object sixx.id="0" sixx.type="Array" sixx.formatter="SixxMockLiteralArrayFormatter" >
<sixx.object sixx.id="1" sixx.type="String" >#(1 2 3 4 5)</sixx.object>
</sixx.object>'
SixxContext resetFormatters.
SixxContext applyFormatters: {SixxMockLiteralArrayFormatter on: Array} while: [
array sixxString.
]
SixxContext evaluate: [array sixxString]
formattersBy: [:formatters | formatters add: (SixxMockLiteralArrayFormatter on: Array)].
obj := SixxContext evaluate: [Object readSixxFrom: oldSixx]
shapeChangersBy: [:shapeChangers | shapeChangers at: #SixxShapeChangedObject put: SixxSomeShapeChanger].