Json.Serializable¶
| Implementations: | |
|---|---|
| None | |
Methods¶
| default_deserialize_property(property_name, value, pspec, property_node) | |
| default_serialize_property(property_name, value, pspec) | |
| deserialize_property(property_name, pspec, property_node) | |
| find_property(name) | |
| get_property(pspec) | |
| list_properties() | |
| serialize_property(property_name, value, pspec) | |
| set_property(pspec, value) | 
Virtual Methods¶
| do_deserialize_property(property_name, pspec, property_node) | |
| do_find_property(name) | |
| do_get_property(pspec) | |
| do_serialize_property(property_name, value, pspec) | |
| do_set_property(pspec, value) | 
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- 
class Json.Serializable¶
- Bases: - GObject.GInterface- Structure: - Json.SerializableIface- 
default_deserialize_property(property_name, value, pspec, property_node)¶
- Parameters: - property_name (str) – the name of the property
- value (GObject.Value) – a pointer to an uninitializedGObject.Value
- pspec (GObject.ParamSpec) – aGObject.ParamSpec
- property_node (Json.Node) – aJson.Nodecontaining the serialized property
 - Returns: - Trueif the property was successfully deserialized.- Return type: - Calls the default implementation of the - Json.Serializabledeserialize_property() virtual function- This function can be used inside a custom implementation of the deserialize_property() virtual function in lieu of: - JsonSerializable *iface; gboolean res; iface = g_type_default_interface_peek (JSON_TYPE_SERIALIZABLE); res = iface->deserialize_property (serializable, property_name, value, pspec, property_node); - New in version 0.10. 
- property_name (
 - 
default_serialize_property(property_name, value, pspec)¶
- Parameters: - property_name (str) – the name of the property
- value (GObject.Value) – the value of the property
- pspec (GObject.ParamSpec) – aGObject.ParamSpec
 - Returns: - a - Json.Nodecontaining the serialized property, or- Noneif it should be omitted.- Return type: - Calls the default implementation of the - Json.Serializable- Json.Serializable.do_serialize_property() virtual function.- This function can be used inside a custom implementation of the - Json.Serializable.do_serialize_property() virtual function in lieu of calling the default implementation through- GObject.type_default_interface_peek():- JsonSerializable *iface; JsonNode *node; iface = g_type_default_interface_peek (JSON_TYPE_SERIALIZABLE); node = iface->serialize_property (serializable, property_name, value, pspec); - New in version 0.10. 
- property_name (
 - 
deserialize_property(property_name, pspec, property_node)¶
- Parameters: - property_name (str) – the name of the property
- pspec (GObject.ParamSpec) – aGObject.ParamSpec
- property_node (Json.Node) – aJson.Nodecontaining the serialized property
 - Returns: - Trueif the property was successfully deserialized.- value: - a pointer to an uninitialized - GObject.Value- Return type: - ( - bool, value:- GObject.Value)- Asks a - Json.Serializableimplementation to deserialize the property contained inside property_node into value.- The value can be: - an empty GObject.Valueinitialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since JSON-GLib 1.6)
- a GObject.Valueinitialized with the expected type of the property
 
- property_name (
 - 
find_property(name)¶
- Parameters: - name ( - str) – the name of the property- Returns: - the - GObject.ParamSpecfor the property or- Noneif no property was found- Return type: - GObject.ParamSpecor- None- Calls the - Json.Serializable.do_find_property() implementation on the self instance. *- New in version 0.14. 
 - 
get_property(pspec)¶
- Parameters: - pspec ( - GObject.ParamSpec) – a- GObject.ParamSpec- Returns: - return location for the property value - Return type: - value: - GObject.Value- Calls the - Json.Serializable.do_get_property() implementation on the self instance.- New in version 0.14. 
 - 
list_properties()¶
- Returns: - an array of - GObject.ParamSpec. Use- GLib.free() to free the array when done.- Return type: - [ - GObject.ParamSpec]- Calls the - Json.Serializable.do_list_properties() implementation on the self instance.- New in version 0.14. 
 - 
serialize_property(property_name, value, pspec)¶
- Parameters: - property_name (str) – the name of the property
- value (GObject.Value) – the value of the property
- pspec (GObject.ParamSpec) – aGObject.ParamSpec
 - Returns: - a - Json.Nodecontaining the serialized property- Return type: - Asks a - Json.Serializableimplementation to serialize a- GObject.Objectproperty into a- Json.Nodeobject.
- property_name (
 - 
set_property(pspec, value)¶
- Parameters: - pspec (GObject.ParamSpec) – aGObject.ParamSpec
- value (GObject.Value) – the property value to set
 - Calls the - Json.Serializable.do_set_property() implementation on the self instance.- New in version 0.14. 
- pspec (
 - 
do_deserialize_property(property_name, pspec, property_node) virtual¶
- Parameters: - property_name (str) – the name of the property
- pspec (GObject.ParamSpec) – aGObject.ParamSpec
- property_node (Json.Node) – aJson.Nodecontaining the serialized property
 - Returns: - Trueif the property was successfully deserialized.- value: - a pointer to an uninitialized - GObject.Value- Return type: - ( - bool, value:- GObject.Value)- Asks a - Json.Serializableimplementation to deserialize the property contained inside property_node into value.- The value can be: - an empty GObject.Valueinitialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since JSON-GLib 1.6)
- a GObject.Valueinitialized with the expected type of the property
 
- property_name (
 - 
do_find_property(name) virtual¶
- Parameters: - name ( - str) – the name of the property- Returns: - the - GObject.ParamSpecfor the property or- Noneif no property was found- Return type: - GObject.ParamSpecor- None- Calls the - Json.Serializable.do_find_property() implementation on the serializable instance. *- New in version 0.14. 
 - 
do_get_property(pspec) virtual¶
- Parameters: - pspec ( - GObject.ParamSpec) – a- GObject.ParamSpec- Returns: - return location for the property value - Return type: - value: - GObject.Value- Calls the - Json.Serializable.do_get_property() implementation on the serializable instance.- New in version 0.14. 
 - 
do_serialize_property(property_name, value, pspec) virtual¶
- Parameters: - property_name (str) – the name of the property
- value (GObject.Value) – the value of the property
- pspec (GObject.ParamSpec) – aGObject.ParamSpec
 - Returns: - a - Json.Nodecontaining the serialized property- Return type: - Asks a - Json.Serializableimplementation to serialize a- GObject.Objectproperty into a- Json.Nodeobject.
- property_name (
 - 
do_set_property(pspec, value) virtual¶
- Parameters: - pspec (GObject.ParamSpec) – aGObject.ParamSpec
- value (GObject.Value) – the property value to set
 - Calls the - Json.Serializable.do_set_property() implementation on the serializable instance.- New in version 0.14. 
- pspec (
 
-