GXml.CollectionParent – GXml-0.20 Reference Manual

# CollectionParent

## Object Hierarchy:

## Description:

public interface CollectionParent : Object, Collection

Collection to manage child GXml.DomElement objects mapped to different classes, derived or child type of Collection.items_type

A collection using Collection.items_type as a common parent GLib.Type of a set of instantiatable GLib.Type.

In the next example, is possible to setup a class for Top element, having a GXml.CollectionParent implementation class, supporting reading any kind of derived classes from the Collection.items_type; for the example, Time, Goal and Reque are implementations of, say, Child interface, so they will be added to the collection and deserialized as an instance of the object, based in the node's name.

    <Top>
      <Time/>
      <Goal/>
      <Resque/>

Implementators, should override types property setting up a hash table and use add_supported_type or add_supported_types to add one or a set of types to be supported. types is used by GXml.Parser to detect the types suuported in a collection to create the corresponding objects of the currect instantiable GLib.Type at runtime, adding them to the collection, corresponding to the element's tag's name.

Namespace: GXml
Package: GXml-0.20

## Content:

### Properties:

- public virtual HashTable<string,Type> types { owned get; }
  Creates a hash map with a set of child instantiable GLib.Type of the Collection.items_type

### Static methods:

- public static void add_supported_type (HashTable<string,Type> types, Type parent_type, Type type)
  Insert a new supported instantiatable type in given hash table, by instantiating the type, getting its node's local name as key.
- public static void add_supported_types (HashTable<string,Type> table, Type parent_type, Type[] types)
  Insert a set of supported instantiatable type in given hash table, by instantiating the type, getting its node's local name as key.

### Inherited Members:

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref

All known members inherited from interface GXml.Collection

- append
- clear
- create_item
- element

- get_item
- initialize
- items_name
- items_type

- length
- nodes_index
- search
- validate_append