* return doc.create_comment ("<!-- baked on Nov 16 2013 by Wallace Wells -->");
* return (doc as Document).create_comment ("<!-- baked on Nov 16 2013 by Wallace Wells -->");
* }
* }
* }}}
* }}}
*
*
...
@@ -135,7 +135,7 @@ namespace GXml.Jgs {
...
@@ -135,7 +135,7 @@ namespace GXml.Jgs {
* by overriding {@link Serializable.serialize_property}
* by overriding {@link Serializable.serialize_property}
* and simply returning true.
* and simply returning true.
*
*
* @param doc The {@link GXml.Document} that contains serialized XML, used to create new {@link GXml.Node}s
* @param doc The {@link GXml.Document} that contains serialized XML, used to create new {@link GXml.Node}s. It is represented as a {@link GXml.Node} for interface compatibility with other implementations.
*
*
* @return A {@link GXml.Node} representing serialized content from the implementing object
* @return A {@link GXml.Node} representing serialized content from the implementing object
*/
*/
...
@@ -151,24 +151,23 @@ namespace GXml.Jgs {
...
@@ -151,24 +151,23 @@ namespace GXml.Jgs {
* individual property. The implementing class
* individual property. The implementing class
* receives a description of it, and should create a
* receives a description of it, and should create a
* {@link GXml.Node} that encapsulates the property.
* {@link GXml.Node} that encapsulates the property.
* {@link GXml.Serialization} will embed the {@link GXml.Node} into
* {@link GXml.Jgs.Serialization} will embed the {@link GXml.Node} into
* a "Property" {@link GXml.Element}, so the {@link GXml.Node}
* a "Property" {@link GXml.Element}, so the {@link GXml.Node}
* returned can often be something as simple as
* returned can often be something as simple as
* {@link GXml.Text}.
* {@link GXml.Text}.
*
*
* To let {@link GXml.Serialization} attempt to automatically
* To let {@link GXml.Jgs.Serialization} attempt to automatically
* serialize the property itself, do not implement
* serialize the property itself, do not implement
* this method. If the method returns %NULL,
* this method. If the method returns %NULL,
* {@link GXml.Serialization} will attempt handle it itself.
* {@link GXml.Jgs.Serialization} will attempt handle it itself.
*
*
* @param property_name String name of a property to serialize
* @param doc The {@link GXml.Document} as a {@link GXml.Node} that the returned {@link GXml.Node} should belong to. It is a {@link GXml.Node} for compatibility with other interface implementations. Use it to create document nodes to represent the property.
* @param spec The {@link GLib.ParamSpec} describing the property
* @param property_spec The {@link GLib.ParamSpec} describing the property
* @param doc The {@link GXml.Document} the returned {@link GXml.Node} should belong to
*
*
* @return a new {@link GXml.Node}, or %NULL
* @return a new {@link GXml.Node}, or %NULL
*/
*/
publicvirtualGXml.Node?
publicvirtualGXml.Node?
serialize_property(GXml.Nodeproperty_element,
serialize_property(GXml.Nodedoc,
GLib.ParamSpecproperty_spec)
GLib.ParamSpecproperty_spec)
throwsGLib.Error{
throwsGLib.Error{
/* TODO: see if esodan changes xom's
/* TODO: see if esodan changes xom's
...
@@ -209,7 +208,7 @@ namespace GXml.Jgs {
...
@@ -209,7 +208,7 @@ namespace GXml.Jgs {
* individual property. The implementing class
* individual property. The implementing class
* receives a description of the property and the
* receives a description of the property and the
* {@link GXml.Node} that contains the content. The
* {@link GXml.Node} that contains the content. The
* implementing {@link GXml.Serializable} object can extract
* implementing {@link GXml.Jgs.Serializable} object can extract
* the data from the {@link GXml.Node} and store it in its
* the data from the {@link GXml.Node} and store it in its
* property itself. Note that the {@link GXml.Node} may be
* property itself. Note that the {@link GXml.Node} may be
* as simple as a {@link GXml.Text} that stores the data as a
* as simple as a {@link GXml.Text} that stores the data as a
...
@@ -217,16 +216,14 @@ namespace GXml.Jgs {
...
@@ -217,16 +216,14 @@ namespace GXml.Jgs {
*
*
* If the implementation has handled deserialization,
* If the implementation has handled deserialization,
* return true. Return false if you want
* return true. Return false if you want
* {@link GXml.Serialization} to try to automatically
* {@link GXml.Jgs.Serialization} to try to automatically
* deserialize it. If {@link GXml.Serialization} tries to
* deserialize it. If {@link GXml.Jgs.Serialization} tries to
* handle it, it will want either {@link GXml.Serializable}'s
* handle it, it will want either {@link GXml.Serializable}'s
* set_property (or at least {@link GLib.Object.set_property})
* set_property (or at least {@link GLib.Object.set_property})
* to know about the property.
* to know about the property.
*
*
* @param property_name the name of the property as a string
* @param property_node the {@link GXml.Node} encapsulating data to deserialize; the node should carry the type, from which you can find the property spec if necessary
* @param spec the {@link GLib.ParamSpec} describing the property
* @return `true` if the property was handled, `false` if {@link GXml.Jgs.Serialization} should handle it
* @param property_node the {@link GXml.Node} encapsulating data to deserialize
* @return `true` if the property was handled, `false` if {@link GXml.Serialization} should handle it
*/
*/
/*
/*
* @todo: consider not giving property_name, but
* @todo: consider not giving property_name, but
...
@@ -236,7 +233,7 @@ namespace GXml.Jgs {
...
@@ -236,7 +233,7 @@ namespace GXml.Jgs {
publicvirtualbool
publicvirtualbool
deserialize_property(GXml.Nodeproperty_node)
deserialize_property(GXml.Nodeproperty_node)
throwsGLib.Error{
throwsGLib.Error{
returnfalse;// default deserialize_property gets used
returnfalse;// default deserialize_property in jgs.Serialization gets used
}
}
...
@@ -245,30 +242,31 @@ namespace GXml.Jgs {
...
@@ -245,30 +242,31 @@ namespace GXml.Jgs {
/*
/*
* Handles finding the {@link GLib.ParamSpec} for a given property.
* Handles finding the {@link GLib.ParamSpec} for a given property.
*
*
* @param property_name the name of a property to obtain a {@link GLib.ParamSpec} for
* {@link GXml.Jgs.Serialization} uses {@link
* @return a {@link GLib.ParamSpec} describing the named property
*
* {@link GXml.Serialization} uses {@link
* GLib.ObjectClass.find_property} (as well as {@link
* GLib.ObjectClass.find_property} (as well as {@link
* GLib.ObjectClass.list_properties}, {@link
* GLib.ObjectClass.list_properties}, {@link
* GLib.Object.get_property}, and {@link
* GLib.Object.get_property}, and {@link
* GLib.Object.set_property}) to manage serialization
* GLib.Object.set_property}) to manage serialization
* of properties. {@link GXml.Serializable} gives the
* of properties. {@link GXml.Jgs.Serializable} gives the
* implementing class an opportunity to override
* implementing class an opportunity to provide their own
* logic for
* {@link GLib.ObjectClass.find_property} to control
* {@link GLib.ObjectClass.find_property} to control
* what properties exist for {@link GXml.Serialization}'s
* what properties exist for {@link GXml.Jgs.Serialization}'s
* purposes.
* purposes.
*
*
* For instance, if an object has private data fields
* For instance, if an object has private data fields
* that are not installed public properties, but that
* that are not installed public properties, but that
* should be serialized, find_property can be defined
* should be serialized, find_property_sn can be defined
* to return a {@link GLib.ParamSpec} for non-installed
* to return a {@link GLib.ParamSpec} for non-installed
* properties. Other {@link GXml.Serializable} functions
* properties. Other {@link GXml.Jgs.Serializable} functions
* should be consistent with it.
* should be consistent with it.
*
*
* An implementing class might wish to maintain such
* An implementing class might wish to maintain such
* {@link GLib.ParamSpec} s separately, rather than creating new
* {@link GLib.ParamSpec} s separately, rather than creating new
* ones for each call.
* ones for each call.
*
* @param property_name the name of a property to obtain a {@link GLib.ParamSpec} for
* @return a {@link GLib.ParamSpec} describing the named property