facet class sys::Serializable
sys::Obj sys::Serializable : sys::Facet
@FacetMeta { inherited=true }@Serializable
Serializable is a facet used to annotate types which can be serialized. Objects are serialized via OutStream.writeObj and deserialized via InStream.readObj.
See the Serialization Doc for details.
- collection
-
const Bool collection := falseCollections are serialized with a collection of child objects using the following rules where
Itemis the item type:- Provide an
add(Item)method to add child items duringreadObj - Provide an
each(|Item| f)method to iterate child items duringwriteObj
- Provide an
- simple
-
const Bool simple := falseSimples are serialized atomically via a customized string representation using the following rules:
- Override
Obj.toStrto return a suitable string representation of the object. - Must declare a static method called
fromStrwhich takes oneStrparameter and returns an instance of the declaring type. ThefromStrmethod may contain additional parameters if they declare defaults.
- Override