[gxml/serialization: 106/106] Fixes after 'soc2013' branch merge
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml/serialization: 106/106] Fixes after 'soc2013' branch merge
- Date: Tue, 30 Jul 2013 23:29:33 +0000 (UTC)
commit 413cd1e63931196170eddc0a14731fe939659d92
Author: Daniel Espinosa <esodan gmail com>
Date: Tue Jul 30 16:14:43 2013 -0500
Fixes after 'soc2013' branch merge
gxml/NodeList.vala | 6 +----
gxml/Serializable.vala | 40 ++++++++++++++++++------------------
gxml/SerializableObjectModel.vala | 2 +-
gxml/Serialization.vala | 8 +-----
test/SerializableTest.vala | 27 +++++-------------------
5 files changed, 30 insertions(+), 53 deletions(-)
---
diff --git a/gxml/NodeList.vala b/gxml/NodeList.vala
index 61f7fe9..99f8dd6 100644
--- a/gxml/NodeList.vala
+++ b/gxml/NodeList.vala
@@ -42,8 +42,6 @@ namespace GXml {
* URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-536297177]]
*/
public interface NodeList : Gee.Iterable<Node> {
-
- public abstract ulong length { get; private set; }
/* NOTE:
* children should define constructors like:
* internal NodeList (Xml.Node* head, Document owner);
@@ -55,9 +53,7 @@ namespace GXml {
* Version: DOM Level 1 Core
* URL: [[http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#attribute-length]]
*/
- public abstract ulong length {
- get; private set;
- }
+ public abstract ulong length { get; private set; }
/* ** NodeList methods ** */
diff --git a/gxml/Serializable.vala b/gxml/Serializable.vala
index 6a88e66..94a190c 100644
--- a/gxml/Serializable.vala
+++ b/gxml/Serializable.vala
@@ -72,7 +72,7 @@ namespace GXml {
*/
public interface Serializable : GLib.Object {
/**
- * Defines the way to set DomNode name.
+ * Defines the way to set Node name.
*
* By default is set to object's type's name lowercase.
*
@@ -89,7 +89,7 @@ namespace GXml {
*/
public abstract HashTable<string,GLib.ParamSpec> ignored_serializable_properties { get;
protected set; }
/**
- * On deserialization stores any { link DomNode} not used on this
+ * On deserialization stores any { link Node} not used on this
* object, but exists in current XML file.
*
* This property must be ignored on serialisation.
@@ -108,7 +108,7 @@ namespace GXml {
*
* @doc an { link GXml.Document} object to serialise to
*/
- public virtual Node? serialize (DomNode node) throws DomError
+ public virtual Node? serialize (Node node) throws DomError
{
Document doc;
if (node is Document)
@@ -163,7 +163,7 @@ namespace GXml {
var obj = (Serializable) v.get_object ();
return obj.serialize (element);
}
- DomNode node = null;
+ Node node = null;
Value oval = Value (prop.value_type);
get_property (prop.name, ref oval);
string val = "";
@@ -180,7 +180,7 @@ namespace GXml {
}
else
attr.value = val;
- return (DomNode) attr;
+ return (Node) attr;
}
this.serialize_unknown_property (element, prop, out node);
return node;
@@ -189,9 +189,9 @@ namespace GXml {
/**
* Deserialize this object.
*
- * @node { link GXml.DomNode} used to deserialize from.
+ * @node { link GXml.Node} used to deserialize from.
*/
- public virtual DomNode? deserialize (DomNode node)
+ public virtual Node? deserialize (Node node)
throws SerializableError,
DomError
{
@@ -216,7 +216,7 @@ namespace GXml {
if (element.has_child_nodes ())
{
GLib.message ("Have child Elements ...");
- foreach (DomNode n in element.child_nodes)
+ foreach (Node n in element.child_nodes)
{
GLib.message (@"Deseralizing Element: $(n.node_name)");
deserialize_property (n);
@@ -232,19 +232,19 @@ namespace GXml {
* Interface method to handle deserialization of an
* individual property. The implementing class
* receives a description of the property and the
- * { link GXml.DomNode} that contains the content. The
+ * { link GXml.Node} that contains the content. The
* implementing { link GXml.Serializable} object can extract
- * the data from the { link GXml.DomNode} and store it in its
- * property itself. Note that the { link GXml.DomNode} may be
+ * the data from the { link GXml.Node} and store it in its
+ * property itself. Note that the { link GXml.Node} may be
* as simple as a { link GXml.Text} that stores the data as a
* string.
*
* @param property_name the name of the property as a string
* @param spec the { link GLib.ParamSpec} describing the property.
- * @param property_node the { link GXml.DomNode} encapsulating data to deserialize
+ * @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.
*/
- public virtual bool deserialize_property (GXml.DomNode property_node)
+ public virtual bool deserialize_property (GXml.Node property_node)
throws SerializableError,
DomError
{
@@ -272,9 +272,9 @@ namespace GXml {
}
else {
Value val = Value (prop.value_type);
- if (Value.type_transformable (typeof (DomNode), prop.value_type))
+ if (Value.type_transformable (typeof (Node), prop.value_type))
{
- Value tmp = Value (typeof (DomNode));
+ Value tmp = Value (typeof (Node));
tmp.set_object (property_node);
ret = tmp.transform (ref val);
set_property (prop.name, val);
@@ -300,19 +300,19 @@ namespace GXml {
/**
* Signal to serialize unknown properties.
*
- * @node a { link GXml.DomNode} to add attribute or child nodes to
+ * @node a { link GXml.Node} to add attribute or child nodes to
* @prop a { link GLib.ParamSpec} describing attribute to serialize
* @attribute set to the { link GXml.Attr} representing this attribute
*/
- public signal void serialize_unknown_property (DomNode element, ParamSpec prop, out DomNode
node);
+ public signal void serialize_unknown_property (Node element, ParamSpec prop, out Node node);
/**
* Signal to deserialize array properties.
*
- * @node a { link GXml.DomNode} to get attribute from
+ * @node a { link GXml.Node} to get attribute from
* @prop a { link GLib.ParamSpec} describing attribute to deserialize
*/
- public signal void deserialize_unknown_property (DomNode node, ParamSpec prop);
+ public signal void deserialize_unknown_property (Node node, ParamSpec prop);
/*
* Handles finding the { link GLib.ParamSpec} for a given property.
@@ -373,7 +373,7 @@ namespace GXml {
get_class
().find_property("serializable-node-name"));
}
if (unknown_serializable_property == null) {
- unknown_serializable_property = new HashTable<string,GXml.DomNode> (str_hash,
str_equal);
+ unknown_serializable_property = new HashTable<string,GXml.Node> (str_hash,
str_equal);
}
}
diff --git a/gxml/SerializableObjectModel.vala b/gxml/SerializableObjectModel.vala
index a24f974..5dea192 100644
--- a/gxml/SerializableObjectModel.vala
+++ b/gxml/SerializableObjectModel.vala
@@ -26,7 +26,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
public GLib.HashTable<string,GLib.ParamSpec> ignored_serializable_properties { get; protected set; }
public bool serializable_property_use_nick { get; set; }
public string? serialized_xml_node_value { get; protected set; default=null; }
- public GLib.HashTable<string,GXml.DomNode> unknown_serializable_property { get; protected set; }
+ public GLib.HashTable<string,GXml.Node> unknown_serializable_property { get; protected set; }
public string serializable_node_name { get; protected set; }
public SerializableObjectModel ()
diff --git a/gxml/Serialization.vala b/gxml/Serialization.vala
index 2cdd887..6cf7b8b 100644
--- a/gxml/Serialization.vala
+++ b/gxml/Serialization.vala
@@ -88,16 +88,12 @@ namespace GXml {
* { link GLib.Value} can transform into a string, and
* operates recursively.
*/
-<<<<<<< HEAD
- private static GXml.DomNode serialize_property (GLib.Object object,
+ private static GXml.Node serialize_property (GLib.Object object,
ParamSpec prop_spec,
GXml.Document doc)
throws SerializationError,
DomError
{
-=======
- private static GXml.Node serialize_property (GLib.Object object, ParamSpec prop_spec,
GXml.Document doc) throws SerializationError {
->>>>>>> gsoc2013
Type type;
Value value;
Node value_node;
@@ -227,7 +223,7 @@ namespace GXml {
Element root;
ParamSpec[] prop_specs;
Element prop;
- DomNode value_prop = null;
+ Node value_prop = null;
string oid;
// If the object has been serialized before, let's not do it again!
diff --git a/test/SerializableTest.vala b/test/SerializableTest.vala
index a4bf7dd..56b0ab3 100644
--- a/test/SerializableTest.vala
+++ b/test/SerializableTest.vala
@@ -31,7 +31,7 @@ public class SerializableTomato : GLib.Object, GXml.Serializable
public GLib.HashTable<string,GLib.ParamSpec> ignored_serializable_properties { get; private set; }
public bool serializable_property_use_nick { get; set; }
public string? serialized_xml_node_value { get; protected set; }
- public GLib.HashTable<string,GXml.DomNode> unknown_serializable_property { get; private set; }
+ public GLib.HashTable<string,GXml.Node> unknown_serializable_property { get; private set; }
public string serializable_node_name { get; protected set; }
public int weight;
@@ -70,7 +70,7 @@ public class SerializableCapsicum : GLib.Object, GXml.Serializable
public GLib.HashTable<string,GLib.ParamSpec> ignored_serializable_properties { get; private set; }
public bool serializable_property_use_nick { get; set; }
public string? serialized_xml_node_value { get; protected set; }
- public GLib.HashTable<string,GXml.DomNode> unknown_serializable_property { get; private set; }
+ public GLib.HashTable<string,GXml.Node> unknown_serializable_property { get; private set; }
public string serializable_node_name { get; protected set; }
public int weight;
@@ -97,19 +97,10 @@ public class SerializableCapsicum : GLib.Object, GXml.Serializable
serializable_node_name = "capsicum";
}
-<<<<<<< HEAD
- public bool deserialize_property (GXml.DomNode property_node)
+ public bool deserialize_property (GXml.Node property_node)
throws SerializableError,
DomError
{
-=======
- /* TODO: do we really need GLib.Value? or should we modify the object directly?
- Want an example using GBoxed too
- Perhaps these shouldn't be object methods, perhaps they should be static?
- Can't have static methods in an interface :(, right? */
- public bool deserialize_property (string property_name, /* out GLib.Value value, */
- GLib.ParamSpec spec, GXml.Node property_node) {
->>>>>>> gsoc2013
GLib.Value outvalue = GLib.Value (typeof (int));
switch (property_node.node_name) {
@@ -132,18 +123,12 @@ public class SerializableCapsicum : GLib.Object, GXml.Serializable
return false;
}
-<<<<<<< HEAD
- public GXml.DomNode? serialize_property (Element element,
+ public GXml.Node? serialize_property (Element element,
GLib.ParamSpec spec)
throws DomError
{
- GXml.Document doc = element.owner_document;
-=======
- public GXml.Node? serialize_property (string property_name, /*GLib.Value value,*/ GLib.ParamSpec
spec, GXml.Document doc) {
- GXml.Element c_prop;
->>>>>>> gsoc2013
GXml.Element rating;
-
+ Document doc = element.owner_document;
switch (spec.name) {
case "ratings":
GXml.DocumentFragment frag = doc.create_document_fragment ();
@@ -177,7 +162,7 @@ public class SerializableBanana : GLib.Object, GXml.Serializable
public GLib.HashTable<string,GLib.ParamSpec> ignored_serializable_properties { get; private set; }
public bool serializable_property_use_nick { get; set; }
public string? serialized_xml_node_value { get; protected set; }
- public GLib.HashTable<string,GXml.DomNode> unknown_serializable_property { get; private set; }
+ public GLib.HashTable<string,GXml.Node> unknown_serializable_property { get; private set; }
public string serializable_node_name { get; protected set; }
private int private_field;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]