Method Serializer.Serializable()->_deserialize()

class Serializer.Serializable

Method _deserialize

protected void _deserialize(object o, function(mixed, string, type, multiset|zero, multiset|zero:void) deserializer, int|void recurse)

Description

Dispatch function for deserialization.

Parameter o

Object to visit. Always a context of the current object.

Parameter deserializer

Function to typically be called once for every variable in the inheriting class.

Parameter recurse

Forwarded to the default variable hook.

This function calls _deserialize_variable() once for every variable in the inheriting class, which in turn will call deserializer with the arguments:

Argument 1

The setter for the variable.

Argument 2

The name of the variable.

Argument 3

The declared type of the variable.

Argument 4

The annotations directly on the variable.

Argument 5

The effective annotations along the variable's inherit path.

Before visiting fields, the callback receives the object with the reserved name "\0begin"; after successful completion it receives "\0end". For both events, argument 1 is the object in the selected context, argument 3 is its object type, argument 4 contains that context's own annotations, and argument 5 is UNDEFINED. These events bypass the variable hook, and are emitted even for objects without fields. Errors abort the sequence without emitting an exit event.

Note

The symbols will be listed in the order they were defined in the class.

Note

This function is typically called via Serializer.deserialize().

See also

Serializer.deserialize(), _deserialize_variable(), _serialize(), Builtin.Setter