Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gxml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Canek Peláez Valdés
Gxml
Commits
9aaecd0d
Commit
9aaecd0d
authored
10 years ago
by
Daniel Espinosa
Browse files
Options
Downloads
Patches
Plain Diff
SerializableObjectModel removing more references to xElement
parent
3e7cd143
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
gxml/SerializableObjectModel.vala
+9
-9
9 additions, 9 deletions
gxml/SerializableObjectModel.vala
with
9 additions
and
9 deletions
gxml/SerializableObjectModel.vala
+
9
−
9
View file @
9aaecd0d
...
@@ -21,13 +21,13 @@
...
@@ -21,13 +21,13 @@
*/
*/
/**
/**
* Object Model is an {@link Serializable} implementation using {@link
x
Element}
* Object Model is an {@link Serializable} implementation using {@link Element}
* to represent {@link GLib.Object} class objects.
* to represent {@link GLib.Object} class objects.
*
*
* This implementation consider each object as a XML node, represented in GXml
* This implementation consider each object as a XML node, represented in GXml
* as a {@link GXml.
x
Element} and its properties is represented by {@link GXml.Attr}.
* as a {@link GXml.Element} and its properties is represented by {@link GXml.Attr}.
* Each property, if it is a {@link Serializable} object, is represented as child
* Each property, if it is a {@link Serializable} object, is represented as child
* {@link
x
Element}.
* {@link Element}.
*
*
* If a object's value property must be represented as a XML node content,
* If a object's value property must be represented as a XML node content,
* then it requires to override {@link Serializable.serialize_use_xml_node_value}
* then it requires to override {@link Serializable.serialize_use_xml_node_value}
...
@@ -95,7 +95,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
...
@@ -95,7 +95,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
public
virtual
GXml
.
Node
?
serialize
(
GXml
.
Node
node
)
public
virtual
GXml
.
Node
?
serialize
(
GXml
.
Node
node
)
throws
GLib
.
Error
throws
GLib
.
Error
requires
(
node_name
()
!=
null
)
requires
(
node_name
()
!=
null
)
requires
(
node
is
xDocument
||
node
is
x
Element
)
requires
(
node
is
xDocument
||
node
is
GXml
.
Element
)
{
{
return
default_serialize
(
node
);
return
default_serialize
(
node
);
}
}
...
@@ -117,8 +117,8 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
...
@@ -117,8 +117,8 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
serialize_property
(
element
,
spec
);
serialize_property
(
element
,
spec
);
}
}
if
(
get_enable_unknown_serializable_property
())
{
if
(
get_enable_unknown_serializable_property
())
{
foreach
(
Node
n
in
unknown_serializable_property
.
get_values
())
{
foreach
(
GXml
.
Node
n
in
unknown_serializable_property
.
get_values
())
{
if
(
n
is
x
Element
)
{
if
(
n
is
GXml
.
Element
)
{
var
e
=
doc
.
create_element
(
n
.
name
);
var
e
=
doc
.
create_element
(
n
.
name
);
GXml
.
Node
.
copy
(
node
.
document
,
e
,
n
,
true
);
GXml
.
Node
.
copy
(
node
.
document
,
e
,
n
,
true
);
element
.
childs
.
add
(
e
);
element
.
childs
.
add
(
e
);
...
@@ -151,7 +151,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
...
@@ -151,7 +151,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
GLib
.
ParamSpec
prop
)
GLib
.
ParamSpec
prop
)
throws
GLib
.
Error
throws
GLib
.
Error
{
{
if
(
element
is
x
Element
)
if
(
element
is
GXml
.
Element
)
return
default_serialize_property
((
GXml
.
Element
)
element
,
prop
);
return
default_serialize_property
((
GXml
.
Element
)
element
,
prop
);
return
null
;
return
null
;
}
}
...
@@ -254,7 +254,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
...
@@ -254,7 +254,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
#if DEBUG
#if DEBUG
stdout
.
printf
(
@"Elements Nodes in Node: $(element.name)\n"
);
stdout
.
printf
(
@"Elements Nodes in Node: $(element.name)\n"
);
#endif
#endif
if
(
((
xElement
)
element
).
has_child_nodes
()
)
if
(
element
.
childs
.
size
>
0
)
{
{
if
(
get_type
().
is_a
(
typeof
(
SerializableContainer
)))
if
(
get_type
().
is_a
(
typeof
(
SerializableContainer
)))
{
{
...
@@ -294,7 +294,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
...
@@ -294,7 +294,7 @@ public abstract class GXml.SerializableObjectModel : Object, Serializable
}
}
}
}
}
}
if
(
n
is
x
Element
&&
!
cnodes
.
has_key
(
n
.
name
))
{
if
(
n
is
GXml
.
Element
&&
!
cnodes
.
has_key
(
n
.
name
))
{
#if DEBUG
#if DEBUG
stdout
.
printf
(
@"$(get_type ().name ()): DESERIALIZING ELEMENT '$(n.name)'\n"
);
stdout
.
printf
(
@"$(get_type ().name ()): DESERIALIZING ELEMENT '$(n.name)'\n"
);
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment