TRUE if the property was successfully deserializedjson.serializable_mixin
Module for [Serializable] interface mixin
Templates 2
[json.serializable.Serializable] is an interface for controlling the serialization and deserialization of [gobject.object.ObjectWrap] classes.
Implementing this interface allows controlling how the class is going to be serialized or deserialized by func@Json.construct_gobject and func@Json.serialize_gobject, respectively.
Calls the default implementation of the vfuncJson.Serializable.deserialize_property virtual function.
This function can be used inside a custom implementation of the deserialize_property() virtual function in lieu of calling the default implementation through [gobject.global.typeDefaultInterfacePeek]:
JsonSerializable *iface;
gboolean res;
iface = g_type_default_interface_peek (JSON_TYPE_SERIALIZABLE);
res = iface->deserialize_property (serializable, property_name,
value,
pspec,
property_node);Parameters
propertyName | the name of the property to deserialize |
value | a pointer to an uninitialized value |
pspec | a property description |
propertyNode | the JSON node containing the serialized property |
Returns
Calls the default implementation of the vfuncJson.Serializable.serialize_property virtual function.
This function can be used inside a custom implementation of the serialize_property() virtual function in lieu of calling the default implementation through [gobject.global.typeDefaultInterfacePeek]:
JsonSerializable *iface;
JsonNode *node;
iface = g_type_default_interface_peek (JSON_TYPE_SERIALIZABLE);
node = iface->serialize_property (serializable, property_name,
value,
pspec);This function will return NULL if the property could not be serialized.
Parameters
propertyName | the name of the property to serialize |
value | the value of the property to serialize |
pspec | a property description |
Returns
serialized property
Asks a [json.serializable.Serializable] implementation to deserialize the property contained inside property_node and place its value into value.
The value can be:
- an empty [gobject.value.Value] initialized by
G_VALUE_INIT, which will be automatically
initialized with the expected type of the property by using the given property description (since JSON-GLib 1.6)
- a [gobject.value.Value] initialized with the expected type of the property
This function will not be called for properties that are marked as as G_PARAM_CONSTRUCT_ONLY.
Parameters
propertyName | the name of the property to serialize |
value | a pointer to an uninitialized value |
pspec | a property description |
propertyNode | the JSON node containing the serialized property |
Returns
TRUE if the property was successfully deserializedCalls the vfuncJson.Serializable.find_property implementation on the [json.serializable.Serializable] instance, which will return the property description for the given name.
Parameters
name | the name of the property |
Returns
Calls the vfuncJson.Serializable.get_property implementation on the [json.serializable.Serializable] instance, which will get the value of the given property.
Parameters
pspec | a property description |
value | return location for the property value |
Calls the vfuncJson.Serializable.list_properties implementation on the [json.serializable.Serializable] instance, which will return the list of serializable properties.
Returns
properties of the object
Asks a [json.serializable.Serializable] implementation to serialize an object property into a JSON node.
Parameters
propertyName | the name of the property to serialize |
value | the value of the property to serialize |
pspec | a property description |
Returns
Calls the vfuncJson.Serializable.set_property implementation on the [json.serializable.Serializable] instance, which will set the property with the given value.
Parameters
pspec | a property description |
value | the property value to set |