Denotes that a collection of elements is about to be pickled.
Denotes that a collection of elements is about to be pickled.
Note: This must be called after beginEntry()
The length of the collection being serialized.
A pickler which can serialzie the collection.
Called to denote that an object is about to be serialized.
Called to denote that an object is about to be serialized.
The object to be serialized. This may be a primtiive, in which case it can be immediately serialized (or you can wait unitl endEntry is called).
A pbuilder instance a pickler can use to serialize the picklee, if it's a complex type.
Denote that we are done serializing the collection.
Call this to denote that the given primitive, collection or structure being pickled is completed.
Places the next element in the serialized collection.
Places the next element in the serialized collection.
Note: This must be called after beginCollection().
A callback which is passed a pickler able to serialize the item in the collection.
A pickler which can serialize the next element of the collection.
Serialize a "field" in a complex structure/object being pickled.
Serialize a "field" in a complex structure/object being pickled.
The name of the field to serialize.
A callback which will be passed an appropriate pickler. You should ensure this function will perform a beginEntry()/endEntry() block.
A builder for remaining items in the current complex structure being pickled.
Return the resulting pickle of this builder.
A builder of pickled content. This is a mutable API, intended to be called in certain specific ways.
Here are a few static rules that all picklers must follow when using this interface.
1. You will be given a type hint before any beginEntry() call. 2. There will be one endEntry() for every beginEntry() call. 3. There will be one endCollection() for every beginCollection() call. 4. Every beginCollection()/endCollection() pair will be inside a beginEntry()/endEntry() pair. 5. Every putElement() call must happen within a beginCollection()/endCollection() block. 6. Every putField() call must happen within a beginEntry()/endEntry() block. 7. There is no guarantee that putElement() will be called within a beginCollectoin()/endCollection() pair. i.e. we can write empty collections. 8. There is no guarantee that putField will be called within a beginEntry()/endEntry() pair. i.e. if we don't put any fields, this means the entry was for a "primitive" type, at least what The pickling library considers primitives. 9. The order of putField calls in any pickler will be the exact same ordering when unpickling, if the format is compatible.
Here is a list of all types the auto-generated Picklers considers "primitives" and must be directly supported by any PBuilder: