/* Property.c generated by valac 0.56.19, the Vala compiler
 * generated from Property.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
/*
 *
 * Copyright (C) 2016  Daniel Espinosa <esodan@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include "gxml/gxml.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>
#include "gxml.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	GXML_BASE_PROPERTY_0_PROPERTY,
	GXML_BASE_PROPERTY_VALUE_PROPERTY,
	GXML_BASE_PROPERTY_NUM_PROPERTIES
};
static GParamSpec* gxml_base_property_properties[GXML_BASE_PROPERTY_NUM_PROPERTIES];
enum  {
	GXML_STRING_0_PROPERTY,
	GXML_STRING_VALUE_PROPERTY,
	GXML_STRING_NUM_PROPERTIES
};
static GParamSpec* gxml_string_properties[GXML_STRING_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	GXML_ARRAY_STRING_0_PROPERTY,
	GXML_ARRAY_STRING_VALUE_PROPERTY,
	GXML_ARRAY_STRING_NUM_PROPERTIES
};
static GParamSpec* gxml_array_string_properties[GXML_ARRAY_STRING_NUM_PROPERTIES];
enum  {
	GXML_XSD_ARRAY_STRING_0_PROPERTY,
	GXML_XSD_ARRAY_STRING_SIMPLE_TYPE_PROPERTY,
	GXML_XSD_ARRAY_STRING_SOURCE_PROPERTY,
	GXML_XSD_ARRAY_STRING_NUM_PROPERTIES
};
static GParamSpec* gxml_xsd_array_string_properties[GXML_XSD_ARRAY_STRING_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	GXML_DOUBLE_0_PROPERTY,
	GXML_DOUBLE_VALUE_PROPERTY,
	GXML_DOUBLE_DECIMALS_PROPERTY,
	GXML_DOUBLE_NUM_PROPERTIES
};
static GParamSpec* gxml_double_properties[GXML_DOUBLE_NUM_PROPERTIES];
enum  {
	GXML_FLOAT_0_PROPERTY,
	GXML_FLOAT_NUM_PROPERTIES
};
static GParamSpec* gxml_float_properties[GXML_FLOAT_NUM_PROPERTIES];
enum  {
	GXML_INT_0_PROPERTY,
	GXML_INT_VALUE_PROPERTY,
	GXML_INT_NUM_PROPERTIES
};
static GParamSpec* gxml_int_properties[GXML_INT_NUM_PROPERTIES];
enum  {
	GXML_BOOLEAN_0_PROPERTY,
	GXML_BOOLEAN_VALUE_PROPERTY,
	GXML_BOOLEAN_NUM_PROPERTIES
};
static GParamSpec* gxml_boolean_properties[GXML_BOOLEAN_NUM_PROPERTIES];
enum  {
	GXML_ENUM_0_PROPERTY,
	GXML_ENUM_USE_NICK_PROPERTY,
	GXML_ENUM_CAMEL_CASE_PROPERTY,
	GXML_ENUM_UPPER_CASE_PROPERTY,
	GXML_ENUM_VALUE_PROPERTY,
	GXML_ENUM_ENUM_TYPE_PROPERTY,
	GXML_ENUM_NUM_PROPERTIES
};
static GParamSpec* gxml_enum_properties[GXML_ENUM_NUM_PROPERTIES];
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	GXML_DATE_0_PROPERTY,
	GXML_DATE_VALUE_PROPERTY,
	GXML_DATE_NUM_PROPERTIES
};
static GParamSpec* gxml_date_properties[GXML_DATE_NUM_PROPERTIES];
enum  {
	GXML_DATE_TIME_0_PROPERTY,
	GXML_DATE_TIME_FORMAT_PROPERTY,
	GXML_DATE_TIME_VALUE_PROPERTY,
	GXML_DATE_TIME_NUM_PROPERTIES
};
static GParamSpec* gxml_date_time_properties[GXML_DATE_TIME_NUM_PROPERTIES];
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_time_zone_unref0(var) ((var == NULL) ? NULL : (var = (g_time_zone_unref (var), NULL)))

struct _GXmlDoublePrivate {
	guint _decimals;
};

struct _GXmlEnumPrivate {
	gboolean _use_nick;
	gboolean _camel_case;
	gboolean _upper_case;
};

struct _GXmlDateTimePrivate {
	gchar* _format;
};

static gpointer gxml_base_property_parent_class = NULL;
static GXmlPropertyIface * gxml_base_property_gxml_property_parent_iface = NULL;
static gpointer gxml_string_parent_class = NULL;
static gpointer gxml_array_string_parent_class = NULL;
static gpointer gxml_xsd_array_string_parent_class = NULL;
static gint GXmlDouble_private_offset;
static gpointer gxml_double_parent_class = NULL;
static gpointer gxml_float_parent_class = NULL;
static gpointer gxml_int_parent_class = NULL;
static gpointer gxml_boolean_parent_class = NULL;
static gint GXmlEnum_private_offset;
static gpointer gxml_enum_parent_class = NULL;
static gpointer gxml_date_parent_class = NULL;
static gint GXmlDateTime_private_offset;
static gpointer gxml_date_time_parent_class = NULL;

static GType gxml_property_get_type_once (void);
static gboolean gxml_base_property_real_validate_value (GXmlBaseProperty* self,
                                                 const gchar* val);
static GType gxml_base_property_get_type_once (void);
static void _vala_gxml_base_property_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_gxml_base_property_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
static void gxml_string_finalize (GObject * obj);
static GType gxml_string_get_type_once (void);
static void _vala_gxml_string_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec);
static void _vala_gxml_string_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec);
static gchar** _vala_array_dup4 (gchar** self,
                          gssize length);
static void gxml_array_string_finalize (GObject * obj);
static GType gxml_array_string_get_type_once (void);
static void _vala_gxml_array_string_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec);
static void _vala_gxml_array_string_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec);
static void _vala_array_add4 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static gchar** _vala_array_dup5 (gchar** self,
                          gssize length);
static void gxml_xsd_array_string_finalize (GObject * obj);
static GType gxml_xsd_array_string_get_type_once (void);
static void _vala_gxml_xsd_array_string_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_gxml_xsd_array_string_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
static void gxml_double_finalize (GObject * obj);
static GType gxml_double_get_type_once (void);
static void _vala_gxml_double_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec);
static void _vala_gxml_double_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec);
static GType gxml_float_get_type_once (void);
static void gxml_int_finalize (GObject * obj);
static GType gxml_int_get_type_once (void);
static void _vala_gxml_int_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec);
static void _vala_gxml_int_set_property (GObject * object,
                                  guint property_id,
                                  const GValue * value,
                                  GParamSpec * pspec);
static void gxml_boolean_finalize (GObject * obj);
static GType gxml_boolean_get_type_once (void);
static void _vala_gxml_boolean_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec);
static void _vala_gxml_boolean_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec);
static GObject * gxml_enum_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties);
static void gxml_enum_finalize (GObject * obj);
static GType gxml_enum_get_type_once (void);
static void _vala_gxml_enum_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec);
static void _vala_gxml_enum_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec);
static void gxml_date_finalize (GObject * obj);
static GType gxml_date_get_type_once (void);
static void _vala_gxml_date_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec);
static void _vala_gxml_date_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec);
static void gxml_date_time_finalize (GObject * obj);
static GType gxml_date_time_get_type_once (void);
static void _vala_gxml_date_time_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_gxml_date_time_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

gchar*
gxml_property_get_value (GXmlProperty* self)
{
	GXmlPropertyIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = GXML_PROPERTY_GET_INTERFACE (self);
	if (_iface_->get_value) {
		return _iface_->get_value (self);
	}
	return NULL;
}

void
gxml_property_set_value (GXmlProperty* self,
                         const gchar* value)
{
	GXmlPropertyIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = GXML_PROPERTY_GET_INTERFACE (self);
	if (_iface_->set_value) {
		_iface_->set_value (self, value);
	}
}

/**
   * Takes a string and check if it is a valid value for property
   */
gboolean
gxml_property_validate_value (GXmlProperty* self,
                              const gchar* val)
{
	GXmlPropertyIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = GXML_PROPERTY_GET_INTERFACE (self);
	if (_iface_->validate_value) {
		return _iface_->validate_value (self, val);
	}
	return FALSE;
}

static void
gxml_property_default_init (GXmlPropertyIface * iface,
                            gpointer iface_data)
{
	/**
	   * Attribute's value in the parent {@link DomElement} using a string.
	   *
	   * Implementation should take care to validate value before to set or
	   * parse from XML document.
	   */
	g_object_interface_install_property (iface, g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

/**
 * An interface for {@link GXml.Object}'s properties translated to
 * {@link DomElement} attributes. If object is instantiated it is
 * written, if not is just ignored.
 */
static GType
gxml_property_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlPropertyIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_property_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType gxml_property_type_id;
	gxml_property_type_id = g_type_register_static (G_TYPE_INTERFACE, "GXmlProperty", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (gxml_property_type_id, G_TYPE_OBJECT);
	return gxml_property_type_id;
}

GType
gxml_property_get_type (void)
{
	static volatile gsize gxml_property_type_id__once = 0;
	if (g_once_init_enter (&gxml_property_type_id__once)) {
		GType gxml_property_type_id;
		gxml_property_type_id = gxml_property_get_type_once ();
		g_once_init_leave (&gxml_property_type_id__once, gxml_property_type_id);
	}
	return gxml_property_type_id__once;
}

gchar*
gxml_base_property_get_value (GXmlBaseProperty* self)
{
	GXmlBasePropertyClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = GXML_BASE_PROPERTY_GET_CLASS (self);
	if (_klass_->get_value) {
		return _klass_->get_value (self);
	}
	return NULL;
}

void
gxml_base_property_set_value (GXmlBaseProperty* self,
                              const gchar* value)
{
	GXmlBasePropertyClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = GXML_BASE_PROPERTY_GET_CLASS (self);
	if (_klass_->set_value) {
		_klass_->set_value (self, value);
	}
}

/**
   * Takes a string and check if it can be valid for this property.
   */
static gboolean
gxml_base_property_real_validate_value (GXmlBaseProperty* self,
                                        const gchar* val)
{
	gboolean result;
	result = TRUE;
	return result;
}

gboolean
gxml_base_property_validate_value (GXmlBaseProperty* self,
                                   const gchar* val)
{
	GXmlBasePropertyClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = GXML_BASE_PROPERTY_GET_CLASS (self);
	if (_klass_->validate_value) {
		return _klass_->validate_value (self, val);
	}
	return FALSE;
}

GXmlBaseProperty*
gxml_base_property_construct (GType object_type)
{
	GXmlBaseProperty * self = NULL;
	self = (GXmlBaseProperty*) g_object_new (object_type, NULL);
	return self;
}

static void
gxml_base_property_class_init (GXmlBasePropertyClass * klass,
                               gpointer klass_data)
{
	gxml_base_property_parent_class = g_type_class_peek_parent (klass);
	((GXmlBasePropertyClass *) klass)->validate_value = (gboolean (*) (GXmlBaseProperty*, const gchar*)) gxml_base_property_real_validate_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_base_property_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_base_property_set_property;
	/**
	   * {@inheritDoc}
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_BASE_PROPERTY_VALUE_PROPERTY, gxml_base_property_properties[GXML_BASE_PROPERTY_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_base_property_gxml_property_interface_init (GXmlPropertyIface * iface,
                                                 gpointer iface_data)
{
	gxml_base_property_gxml_property_parent_iface = g_type_interface_peek_parent (iface);
	iface->validate_value = (gboolean (*) (GXmlProperty*, const gchar*)) gxml_base_property_validate_value;
	iface->get_value = (gchar* (*) (GXmlProperty*)) gxml_base_property_get_value;
	iface->set_value = (void (*) (GXmlProperty*, const gchar*)) gxml_base_property_set_value;
}

static void
gxml_base_property_instance_init (GXmlBaseProperty * self,
                                  gpointer klass)
{
}

/**
 * Base class for properties implementing {@link Property} interface.
 */
static GType
gxml_base_property_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlBasePropertyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_base_property_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlBaseProperty), 0, (GInstanceInitFunc) gxml_base_property_instance_init, NULL };
	static const GInterfaceInfo gxml_property_info = { (GInterfaceInitFunc) gxml_base_property_gxml_property_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_base_property_type_id;
	gxml_base_property_type_id = g_type_register_static (G_TYPE_OBJECT, "GXmlBaseProperty", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (gxml_base_property_type_id, GXML_TYPE_PROPERTY, &gxml_property_info);
	return gxml_base_property_type_id;
}

GType
gxml_base_property_get_type (void)
{
	static volatile gsize gxml_base_property_type_id__once = 0;
	if (g_once_init_enter (&gxml_base_property_type_id__once)) {
		GType gxml_base_property_type_id;
		gxml_base_property_type_id = gxml_base_property_get_type_once ();
		g_once_init_leave (&gxml_base_property_type_id__once, gxml_base_property_type_id);
	}
	return gxml_base_property_type_id__once;
}

static void
_vala_gxml_base_property_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	GXmlBaseProperty * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_BASE_PROPERTY, GXmlBaseProperty);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_base_property_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	GXmlBaseProperty * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_BASE_PROPERTY, GXmlBaseProperty);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static gchar*
gxml_string_real_get_value (GXmlBaseProperty* base)
{
	gchar* result;
	GXmlString* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (GXmlString*) base;
	_tmp0_ = self->_value;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
gxml_string_real_set_value (GXmlBaseProperty* base,
                            const gchar* value)
{
	GXmlString* self;
	self = (GXmlString*) base;
	if (gxml_base_property_validate_value ((GXmlBaseProperty*) self, value)) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->_value);
		self->_value = _tmp0_;
	}
	g_object_notify_by_pspec ((GObject *) self, gxml_string_properties[GXML_STRING_VALUE_PROPERTY]);
}

GXmlString*
gxml_string_construct_with_string (GType object_type,
                                   const gchar* str)
{
	GXmlString * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (str != NULL, NULL);
	self = (GXmlString*) gxml_base_property_construct (object_type);
	_tmp0_ = g_strdup (str);
	_g_free0 (self->_value);
	self->_value = _tmp0_;
	return self;
}

GXmlString*
gxml_string_new_with_string (const gchar* str)
{
	return gxml_string_construct_with_string (GXML_TYPE_STRING, str);
}

GXmlString*
gxml_string_construct (GType object_type)
{
	GXmlString * self = NULL;
	self = (GXmlString*) gxml_base_property_construct (object_type);
	return self;
}

GXmlString*
gxml_string_new (void)
{
	return gxml_string_construct (GXML_TYPE_STRING);
}

static void
gxml_string_class_init (GXmlStringClass * klass,
                        gpointer klass_data)
{
	gxml_string_parent_class = g_type_class_peek_parent (klass);
	GXML_BASE_PROPERTY_CLASS (klass)->get_value = (gchar* (*) (GXmlBaseProperty*)) gxml_string_real_get_value;
	GXML_BASE_PROPERTY_CLASS (klass)->set_value = (void (*) (GXmlBaseProperty*, const gchar*)) gxml_string_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_string_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_string_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_string_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_STRING_VALUE_PROPERTY, gxml_string_properties[GXML_STRING_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_string_instance_init (GXmlString * self,
                           gpointer klass)
{
	gchar* _tmp0_;
	_tmp0_ = g_strdup ("");
	self->_value = _tmp0_;
}

static void
gxml_string_finalize (GObject * obj)
{
	GXmlString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_STRING, GXmlString);
	_g_free0 (self->_value);
	G_OBJECT_CLASS (gxml_string_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle {@link Element}'s attributes
 * using validated string using Regular Expressions.
 */
static GType
gxml_string_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlStringClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_string_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlString), 0, (GInstanceInitFunc) gxml_string_instance_init, NULL };
	GType gxml_string_type_id;
	gxml_string_type_id = g_type_register_static (GXML_TYPE_BASE_PROPERTY, "GXmlString", &g_define_type_info, 0);
	return gxml_string_type_id;
}

GType
gxml_string_get_type (void)
{
	static volatile gsize gxml_string_type_id__once = 0;
	if (g_once_init_enter (&gxml_string_type_id__once)) {
		GType gxml_string_type_id;
		gxml_string_type_id = gxml_string_get_type_once ();
		g_once_init_leave (&gxml_string_type_id__once, gxml_string_type_id);
	}
	return gxml_string_type_id__once;
}

static void
_vala_gxml_string_get_property (GObject * object,
                                guint property_id,
                                GValue * value,
                                GParamSpec * pspec)
{
	GXmlString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_STRING, GXmlString);
	switch (property_id) {
		case GXML_STRING_VALUE_PROPERTY:
		g_value_take_string (value, gxml_base_property_get_value ((GXmlBaseProperty*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_string_set_property (GObject * object,
                                guint property_id,
                                const GValue * value,
                                GParamSpec * pspec)
{
	GXmlString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_STRING, GXmlString);
	switch (property_id) {
		case GXML_STRING_VALUE_PROPERTY:
		gxml_base_property_set_value ((GXmlBaseProperty*) self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

gchar**
gxml_array_string_get_values (GXmlArrayString* self,
                              gint* result_length1)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar** result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_values;
	_tmp0__length1 = self->_values_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

/**
   * Convenient method to initialize array of values from an array of strings.
   * Values are taken and should not be freed after call initialization.
   */
static gchar**
_vala_array_dup4 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

void
gxml_array_string_initialize_strings (GXmlArrayString* self,
                                      gchar** strs,
                                      gint strs_length1)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (self != NULL);
	if (strs_length1 == 0) {
		strs = (_vala_array_free (strs, strs_length1, (GDestroyNotify) g_free), NULL);
		return;
	}
	_tmp0_ = (strs != NULL) ? _vala_array_dup4 (strs, strs_length1) : strs;
	_tmp0__length1 = strs_length1;
	self->_values = (_vala_array_free (self->_values, self->_values_length1, (GDestroyNotify) g_free), NULL);
	self->_values = _tmp0_;
	self->_values_length1 = _tmp0__length1;
	strs = (_vala_array_free (strs, strs_length1, (GDestroyNotify) g_free), NULL);
}

/**
   * Returns true if current value in attribute is included
   * in the array of values.
   */
gboolean
gxml_array_string_is_valid_value (GXmlArrayString* self)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->_values;
	_tmp0__length1 = self->_values_length1;
	if (_tmp0_ == NULL) {
		result = TRUE;
		return result;
	}
	_tmp1_ = self->_values;
	_tmp1__length1 = self->_values_length1;
	{
		gchar** s_collection = NULL;
		gint s_collection_length1 = 0;
		gint _s_collection_size_ = 0;
		gint s_it = 0;
		s_collection = _tmp1_;
		s_collection_length1 = _tmp1__length1;
		for (s_it = 0; s_it < s_collection_length1; s_it = s_it + 1) {
			gchar* _tmp2_;
			gchar* s = NULL;
			_tmp2_ = g_strdup (s_collection[s_it]);
			s = _tmp2_;
			{
				const gchar* _tmp3_;
				gchar* _tmp4_;
				gchar* _tmp5_;
				gchar* _tmp6_;
				gboolean _tmp7_;
				_tmp3_ = s;
				_tmp4_ = gxml_base_property_get_value ((GXmlBaseProperty*) self);
				_tmp5_ = _tmp4_;
				_tmp6_ = _tmp5_;
				_tmp7_ = g_strcmp0 (_tmp3_, _tmp6_) == 0;
				_g_free0 (_tmp6_);
				if (_tmp7_) {
					result = TRUE;
					_g_free0 (s);
					return result;
				}
				_g_free0 (s);
			}
		}
	}
	result = FALSE;
	return result;
}

/**
   * Select one string from array at index:
   */
void
gxml_array_string_select (GXmlArrayString* self,
                          gint index)
{
	gboolean _tmp0_ = FALSE;
	gchar** _tmp2_;
	gint _tmp2__length1;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	if (index < 0) {
		_tmp0_ = TRUE;
	} else {
		gchar** _tmp1_;
		gint _tmp1__length1;
		_tmp1_ = self->_values;
		_tmp1__length1 = self->_values_length1;
		_tmp0_ = index > _tmp1__length1;
	}
	if (_tmp0_) {
		return;
	}
	_tmp2_ = self->_values;
	_tmp2__length1 = self->_values_length1;
	_tmp3_ = _tmp2_[index];
	gxml_property_set_value ((GXmlBaseProperty*) self, _tmp3_);
}

/**
   * Check if string is in array
   */
gboolean
gxml_array_string_search (GXmlArrayString* self,
                          const gchar* str)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (str != NULL, FALSE);
	_tmp0_ = self->_values;
	_tmp0__length1 = self->_values_length1;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				gchar** _tmp3_;
				gint _tmp3__length1;
				gchar** _tmp4_;
				gint _tmp4__length1;
				const gchar* _tmp5_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = self->_values;
				_tmp3__length1 = self->_values_length1;
				if (!(i < _tmp3__length1)) {
					break;
				}
				_tmp4_ = self->_values;
				_tmp4__length1 = self->_values_length1;
				_tmp5_ = _tmp4_[i];
				if (g_strcmp0 (_tmp5_, str) == 0) {
					result = TRUE;
					return result;
				}
			}
		}
	}
	result = FALSE;
	return result;
}

static gchar*
gxml_array_string_real_get_value (GXmlBaseProperty* base)
{
	gchar* result;
	GXmlArrayString* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (GXmlArrayString*) base;
	_tmp0_ = self->_value;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
gxml_array_string_real_set_value (GXmlBaseProperty* base,
                                  const gchar* value)
{
	GXmlArrayString* self;
	self = (GXmlArrayString*) base;
	if (gxml_base_property_validate_value ((GXmlBaseProperty*) self, value)) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->_value);
		self->_value = _tmp0_;
	}
	g_object_notify_by_pspec ((GObject *) self, gxml_array_string_properties[GXML_ARRAY_STRING_VALUE_PROPERTY]);
}

GXmlArrayString*
gxml_array_string_construct (GType object_type)
{
	GXmlArrayString * self = NULL;
	self = (GXmlArrayString*) gxml_base_property_construct (object_type);
	return self;
}

GXmlArrayString*
gxml_array_string_new (void)
{
	return gxml_array_string_construct (GXML_TYPE_ARRAY_STRING);
}

static void
gxml_array_string_class_init (GXmlArrayStringClass * klass,
                              gpointer klass_data)
{
	gxml_array_string_parent_class = g_type_class_peek_parent (klass);
	GXML_BASE_PROPERTY_CLASS (klass)->get_value = (gchar* (*) (GXmlBaseProperty*)) gxml_array_string_real_get_value;
	GXML_BASE_PROPERTY_CLASS (klass)->set_value = (void (*) (GXmlBaseProperty*, const gchar*)) gxml_array_string_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_array_string_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_array_string_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_array_string_finalize;
	/**
	   * {inheritDoc}
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_ARRAY_STRING_VALUE_PROPERTY, gxml_array_string_properties[GXML_ARRAY_STRING_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_array_string_instance_init (GXmlArrayString * self,
                                 gpointer klass)
{
	gchar* _tmp0_;
	_tmp0_ = g_strdup ("");
	self->_value = _tmp0_;
	self->_values = NULL;
	self->_values_length1 = 0;
}

static void
gxml_array_string_finalize (GObject * obj)
{
	GXmlArrayString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_ARRAY_STRING, GXmlArrayString);
	_g_free0 (self->_value);
	self->_values = (_vala_array_free (self->_values, self->_values_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (gxml_array_string_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle a {@link Element}'s attribute
 * using a list of pre-defined and unmutable values.
 */
static GType
gxml_array_string_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlArrayStringClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_array_string_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlArrayString), 0, (GInstanceInitFunc) gxml_array_string_instance_init, NULL };
	GType gxml_array_string_type_id;
	gxml_array_string_type_id = g_type_register_static (GXML_TYPE_BASE_PROPERTY, "GXmlArrayString", &g_define_type_info, 0);
	return gxml_array_string_type_id;
}

GType
gxml_array_string_get_type (void)
{
	static volatile gsize gxml_array_string_type_id__once = 0;
	if (g_once_init_enter (&gxml_array_string_type_id__once)) {
		GType gxml_array_string_type_id;
		gxml_array_string_type_id = gxml_array_string_get_type_once ();
		g_once_init_leave (&gxml_array_string_type_id__once, gxml_array_string_type_id);
	}
	return gxml_array_string_type_id__once;
}

static void
_vala_gxml_array_string_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec)
{
	GXmlArrayString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_ARRAY_STRING, GXmlArrayString);
	switch (property_id) {
		case GXML_ARRAY_STRING_VALUE_PROPERTY:
		g_value_take_string (value, gxml_base_property_get_value ((GXmlBaseProperty*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_array_string_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec)
{
	GXmlArrayString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_ARRAY_STRING, GXmlArrayString);
	switch (property_id) {
		case GXML_ARRAY_STRING_VALUE_PROPERTY:
		gxml_base_property_set_value ((GXmlBaseProperty*) self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

const gchar*
gxml_xsd_array_string_get_simple_type (GXmlXsdArrayString* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_simple_type;
	result = _tmp0_;
	return result;
}

void
gxml_xsd_array_string_set_simple_type (GXmlXsdArrayString* self,
                                       const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_simple_type);
	self->_simple_type = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, gxml_xsd_array_string_properties[GXML_XSD_ARRAY_STRING_SIMPLE_TYPE_PROPERTY]);
}

GFile*
gxml_xsd_array_string_get_source (GXmlXsdArrayString* self)
{
	GFile* result;
	GFile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_source;
	result = _tmp0_;
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
gxml_xsd_array_string_set_source (GXmlXsdArrayString* self,
                                  GFile* value)
{
	GFile* _tmp0_;
	g_return_if_fail (self != NULL);
	if (!g_file_query_exists (value, NULL)) {
		return;
	}
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->_source);
	self->_source = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, gxml_xsd_array_string_properties[GXML_XSD_ARRAY_STRING_SOURCE_PROPERTY]);
}

/**
   * Load list of strings from a {@link GLib.File}, parsing using an
   * {@link XsdSchema} object and searching for {@link IXsdSimpleType}
   * definition with name {@link simple_type}.
   */
static void
_vala_array_add4 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gchar**
_vala_array_dup5 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

void
gxml_xsd_array_string_load (GXmlXsdArrayString* self,
                            GError** error)
{
	GFile* _tmp0_;
	GFile* _tmp1_;
	const gchar* _tmp2_;
	GXmlXsdSchema* xsd = NULL;
	GXmlXsdSchema* _tmp3_;
	GXmlXsdSchema* _tmp4_;
	GFile* _tmp5_;
	GXmlXsdSchema* _tmp6_;
	GXmlXsdListSimpleTypes* _tmp7_;
	GXmlXsdListSimpleTypes* _tmp8_;
	GXmlXsdSchema* _tmp9_;
	GXmlXsdListSimpleTypes* _tmp10_;
	GXmlXsdListSimpleTypes* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->_source;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->_source;
	if (!g_file_query_exists (_tmp1_, NULL)) {
		return;
	}
	_tmp2_ = self->_simple_type;
	if (_tmp2_ == NULL) {
		return;
	}
	_tmp3_ = gxml_xsd_schema_new ();
	xsd = _tmp3_;
	_tmp4_ = xsd;
	_tmp5_ = self->_source;
	gxml_dom_element_read_from_file ((GXmlDomElement*) _tmp4_, _tmp5_, NULL, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (xsd);
		return;
	}
	_tmp6_ = xsd;
	_tmp7_ = gxml_xsd_schema_get_simple_type_definitions (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ == NULL) {
		_g_object_unref0 (xsd);
		return;
	}
	_tmp9_ = xsd;
	_tmp10_ = gxml_xsd_schema_get_simple_type_definitions (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = gxml_xsd_list_get_length ((GXmlXsdList*) _tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_ == 0) {
		_g_object_unref0 (xsd);
		return;
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp14_ = FALSE;
			_tmp14_ = TRUE;
			while (TRUE) {
				GXmlXsdSchema* _tmp16_;
				GXmlXsdListSimpleTypes* _tmp17_;
				GXmlXsdListSimpleTypes* _tmp18_;
				gint _tmp19_;
				gint _tmp20_;
				GXmlDomElement* _tmp21_ = NULL;
				GXmlXsdSchema* _tmp22_;
				GXmlXsdListSimpleTypes* _tmp23_;
				GXmlXsdListSimpleTypes* _tmp24_;
				GXmlDomElement* _tmp25_;
				GXmlXsdSimpleType* st = NULL;
				GXmlXsdSimpleType* _tmp26_;
				GXmlXsdSimpleType* _tmp27_;
				GXmlXsdSimpleType* _tmp28_;
				const gchar* _tmp29_;
				const gchar* _tmp30_;
				const gchar* _tmp31_;
				gchar* _tmp32_;
				gchar* _tmp33_;
				GXmlXsdSimpleType* _tmp34_;
				const gchar* _tmp35_;
				const gchar* _tmp36_;
				gchar* _tmp37_;
				gchar* _tmp38_;
				gboolean _tmp39_;
				if (!_tmp14_) {
					gint _tmp15_;
					_tmp15_ = i;
					i = _tmp15_ + 1;
				}
				_tmp14_ = FALSE;
				_tmp16_ = xsd;
				_tmp17_ = gxml_xsd_schema_get_simple_type_definitions (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = gxml_xsd_list_get_length ((GXmlXsdList*) _tmp18_);
				_tmp20_ = _tmp19_;
				if (!(i < _tmp20_)) {
					break;
				}
				_tmp22_ = xsd;
				_tmp23_ = gxml_xsd_schema_get_simple_type_definitions (_tmp22_);
				_tmp24_ = _tmp23_;
				_tmp25_ = gxml_collection_get_item ((GXmlCollection*) _tmp24_, i, &_inner_error0_);
				_tmp21_ = _tmp25_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_object_unref0 (xsd);
					return;
				}
				_tmp26_ = _g_object_ref0 (GXML_IS_XSD_SIMPLE_TYPE (_tmp21_) ? ((GXmlXsdSimpleType*) _tmp21_) : NULL);
				st = _tmp26_;
				_tmp27_ = st;
				if (_tmp27_ == NULL) {
					_g_object_unref0 (st);
					_g_object_unref0 (_tmp21_);
					continue;
				}
				_tmp28_ = st;
				_tmp29_ = gxml_xsd_simple_type_get_name (_tmp28_);
				_tmp30_ = _tmp29_;
				if (_tmp30_ == NULL) {
					_g_object_unref0 (st);
					_g_object_unref0 (_tmp21_);
					continue;
				}
				_tmp31_ = self->_simple_type;
				_tmp32_ = g_utf8_strdown (_tmp31_, (gssize) -1);
				_tmp33_ = _tmp32_;
				_tmp34_ = st;
				_tmp35_ = gxml_xsd_simple_type_get_name (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = g_utf8_strdown (_tmp36_, (gssize) -1);
				_tmp38_ = _tmp37_;
				_tmp39_ = g_strcmp0 (_tmp33_, _tmp38_) == 0;
				_g_free0 (_tmp38_);
				_g_free0 (_tmp33_);
				if (_tmp39_) {
					GXmlXsdSimpleType* _tmp40_;
					GXmlXsdTypeRestriction* _tmp41_;
					GXmlXsdTypeRestriction* _tmp42_;
					GXmlXsdSimpleType* _tmp43_;
					GXmlXsdTypeRestriction* _tmp44_;
					GXmlXsdTypeRestriction* _tmp45_;
					GXmlXsdListTypeRestrictionEnumerations* _tmp46_;
					GXmlXsdListTypeRestrictionEnumerations* _tmp47_;
					GXmlXsdSimpleType* _tmp48_;
					GXmlXsdTypeRestriction* _tmp49_;
					GXmlXsdTypeRestriction* _tmp50_;
					GXmlXsdListTypeRestrictionEnumerations* _tmp51_;
					GXmlXsdListTypeRestrictionEnumerations* _tmp52_;
					gint _tmp53_;
					gint _tmp54_;
					gchar** vals = NULL;
					gchar** _tmp55_;
					gint vals_length1;
					gint _vals_size_;
					gchar** _tmp81_;
					gint _tmp81__length1;
					gchar** _tmp82_;
					gint _tmp82__length1;
					_tmp40_ = st;
					_tmp41_ = gxml_xsd_simple_type_get_restriction (_tmp40_);
					_tmp42_ = _tmp41_;
					if (_tmp42_ == NULL) {
						_g_object_unref0 (st);
						_g_object_unref0 (_tmp21_);
						continue;
					}
					_tmp43_ = st;
					_tmp44_ = gxml_xsd_simple_type_get_restriction (_tmp43_);
					_tmp45_ = _tmp44_;
					_tmp46_ = gxml_xsd_type_restriction_get_enumerations (_tmp45_);
					_tmp47_ = _tmp46_;
					if (_tmp47_ == NULL) {
						_g_object_unref0 (st);
						_g_object_unref0 (_tmp21_);
						continue;
					}
					_tmp48_ = st;
					_tmp49_ = gxml_xsd_simple_type_get_restriction (_tmp48_);
					_tmp50_ = _tmp49_;
					_tmp51_ = gxml_xsd_type_restriction_get_enumerations (_tmp50_);
					_tmp52_ = _tmp51_;
					_tmp53_ = gxml_xsd_list_get_length ((GXmlXsdList*) _tmp52_);
					_tmp54_ = _tmp53_;
					if (_tmp54_ == 0) {
						_g_object_unref0 (st);
						_g_object_unref0 (_tmp21_);
						continue;
					}
					_tmp55_ = g_new0 (gchar*, 0 + 1);
					vals = _tmp55_;
					vals_length1 = 0;
					_vals_size_ = vals_length1;
					{
						gint j = 0;
						j = 0;
						{
							gboolean _tmp56_ = FALSE;
							_tmp56_ = TRUE;
							while (TRUE) {
								GXmlXsdSimpleType* _tmp58_;
								GXmlXsdTypeRestriction* _tmp59_;
								GXmlXsdTypeRestriction* _tmp60_;
								GXmlXsdListTypeRestrictionEnumerations* _tmp61_;
								GXmlXsdListTypeRestrictionEnumerations* _tmp62_;
								gint _tmp63_;
								gint _tmp64_;
								GXmlDomElement* _tmp65_ = NULL;
								GXmlXsdSimpleType* _tmp66_;
								GXmlXsdTypeRestriction* _tmp67_;
								GXmlXsdTypeRestriction* _tmp68_;
								GXmlXsdListTypeRestrictionEnumerations* _tmp69_;
								GXmlXsdListTypeRestrictionEnumerations* _tmp70_;
								GXmlDomElement* _tmp71_;
								GXmlXsdTypeRestrictionEnumeration* en = NULL;
								GXmlXsdTypeRestrictionEnumeration* _tmp72_;
								GXmlXsdTypeRestrictionEnumeration* _tmp73_;
								GXmlXsdTypeRestrictionEnumeration* _tmp74_;
								const gchar* _tmp75_;
								const gchar* _tmp76_;
								GXmlXsdTypeRestrictionEnumeration* _tmp77_;
								const gchar* _tmp78_;
								const gchar* _tmp79_;
								gchar* _tmp80_;
								if (!_tmp56_) {
									gint _tmp57_;
									_tmp57_ = j;
									j = _tmp57_ + 1;
								}
								_tmp56_ = FALSE;
								_tmp58_ = st;
								_tmp59_ = gxml_xsd_simple_type_get_restriction (_tmp58_);
								_tmp60_ = _tmp59_;
								_tmp61_ = gxml_xsd_type_restriction_get_enumerations (_tmp60_);
								_tmp62_ = _tmp61_;
								_tmp63_ = gxml_xsd_list_get_length ((GXmlXsdList*) _tmp62_);
								_tmp64_ = _tmp63_;
								if (!(j < _tmp64_)) {
									break;
								}
								_tmp66_ = st;
								_tmp67_ = gxml_xsd_simple_type_get_restriction (_tmp66_);
								_tmp68_ = _tmp67_;
								_tmp69_ = gxml_xsd_type_restriction_get_enumerations (_tmp68_);
								_tmp70_ = _tmp69_;
								_tmp71_ = gxml_collection_get_item ((GXmlCollection*) _tmp70_, j, &_inner_error0_);
								_tmp65_ = _tmp71_;
								if (G_UNLIKELY (_inner_error0_ != NULL)) {
									g_propagate_error (error, _inner_error0_);
									vals = (_vala_array_free (vals, vals_length1, (GDestroyNotify) g_free), NULL);
									_g_object_unref0 (st);
									_g_object_unref0 (_tmp21_);
									_g_object_unref0 (xsd);
									return;
								}
								_tmp72_ = _g_object_ref0 (GXML_IS_XSD_TYPE_RESTRICTION_ENUMERATION (_tmp65_) ? ((GXmlXsdTypeRestrictionEnumeration*) _tmp65_) : NULL);
								en = _tmp72_;
								_tmp73_ = en;
								if (_tmp73_ == NULL) {
									_g_object_unref0 (en);
									_g_object_unref0 (_tmp65_);
									continue;
								}
								_tmp74_ = en;
								_tmp75_ = gxml_xsd_type_restriction_enumeration_get_value (_tmp74_);
								_tmp76_ = _tmp75_;
								if (_tmp76_ == NULL) {
									_g_object_unref0 (en);
									_g_object_unref0 (_tmp65_);
									continue;
								}
								_tmp77_ = en;
								_tmp78_ = gxml_xsd_type_restriction_enumeration_get_value (_tmp77_);
								_tmp79_ = _tmp78_;
								_tmp80_ = g_strdup (_tmp79_);
								_vala_array_add4 (&vals, &vals_length1, &_vals_size_, _tmp80_);
								_g_object_unref0 (en);
								_g_object_unref0 (_tmp65_);
							}
						}
					}
					_tmp81_ = vals;
					_tmp81__length1 = vals_length1;
					_tmp82_ = (_tmp81_ != NULL) ? _vala_array_dup5 (_tmp81_, _tmp81__length1) : _tmp81_;
					_tmp82__length1 = _tmp81__length1;
					gxml_array_string_initialize_strings ((GXmlArrayString*) self, _tmp82_, (gint) _tmp82__length1);
					vals = (_vala_array_free (vals, vals_length1, (GDestroyNotify) g_free), NULL);
				}
				_g_object_unref0 (st);
				_g_object_unref0 (_tmp21_);
			}
		}
	}
	_g_object_unref0 (xsd);
}

GXmlXsdArrayString*
gxml_xsd_array_string_construct (GType object_type)
{
	GXmlXsdArrayString * self = NULL;
	self = (GXmlXsdArrayString*) gxml_array_string_construct (object_type);
	return self;
}

GXmlXsdArrayString*
gxml_xsd_array_string_new (void)
{
	return gxml_xsd_array_string_construct (GXML_TYPE_XSD_ARRAY_STRING);
}

static void
gxml_xsd_array_string_class_init (GXmlXsdArrayStringClass * klass,
                                  gpointer klass_data)
{
	gxml_xsd_array_string_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_xsd_array_string_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_xsd_array_string_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_xsd_array_string_finalize;
	/**
	   * Name of {@link IXsdSimpleType} to use as source.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XSD_ARRAY_STRING_SIMPLE_TYPE_PROPERTY, gxml_xsd_array_string_properties[GXML_XSD_ARRAY_STRING_SIMPLE_TYPE_PROPERTY] = g_param_spec_string ("simple-type", "simple-type", "simple-type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * A {@link GLib.File} source to read from, simple type definitions in
	   * an XSD file type.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XSD_ARRAY_STRING_SOURCE_PROPERTY, gxml_xsd_array_string_properties[GXML_XSD_ARRAY_STRING_SOURCE_PROPERTY] = g_param_spec_object ("source", "source", "source", g_file_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_xsd_array_string_instance_init (GXmlXsdArrayString * self,
                                     gpointer klass)
{
	self->_source = NULL;
	self->_simple_type = NULL;
}

static void
gxml_xsd_array_string_finalize (GObject * obj)
{
	GXmlXsdArrayString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_XSD_ARRAY_STRING, GXmlXsdArrayString);
	_g_object_unref0 (self->_source);
	_g_free0 (self->_simple_type);
	G_OBJECT_CLASS (gxml_xsd_array_string_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle a {@link Element}'s attribute
 * using a list of pre-defined and unmutable values, taken from
 * an {@link IXsdSimpleType} definition
 */
static GType
gxml_xsd_array_string_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlXsdArrayStringClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_xsd_array_string_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlXsdArrayString), 0, (GInstanceInitFunc) gxml_xsd_array_string_instance_init, NULL };
	GType gxml_xsd_array_string_type_id;
	gxml_xsd_array_string_type_id = g_type_register_static (GXML_TYPE_ARRAY_STRING, "GXmlXsdArrayString", &g_define_type_info, 0);
	return gxml_xsd_array_string_type_id;
}

GType
gxml_xsd_array_string_get_type (void)
{
	static volatile gsize gxml_xsd_array_string_type_id__once = 0;
	if (g_once_init_enter (&gxml_xsd_array_string_type_id__once)) {
		GType gxml_xsd_array_string_type_id;
		gxml_xsd_array_string_type_id = gxml_xsd_array_string_get_type_once ();
		g_once_init_leave (&gxml_xsd_array_string_type_id__once, gxml_xsd_array_string_type_id);
	}
	return gxml_xsd_array_string_type_id__once;
}

static void
_vala_gxml_xsd_array_string_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	GXmlXsdArrayString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_XSD_ARRAY_STRING, GXmlXsdArrayString);
	switch (property_id) {
		case GXML_XSD_ARRAY_STRING_SIMPLE_TYPE_PROPERTY:
		g_value_set_string (value, gxml_xsd_array_string_get_simple_type (self));
		break;
		case GXML_XSD_ARRAY_STRING_SOURCE_PROPERTY:
		g_value_set_object (value, gxml_xsd_array_string_get_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_xsd_array_string_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	GXmlXsdArrayString * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_XSD_ARRAY_STRING, GXmlXsdArrayString);
	switch (property_id) {
		case GXML_XSD_ARRAY_STRING_SIMPLE_TYPE_PROPERTY:
		gxml_xsd_array_string_set_simple_type (self, g_value_get_string (value));
		break;
		case GXML_XSD_ARRAY_STRING_SOURCE_PROPERTY:
		gxml_xsd_array_string_set_source (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
gxml_double_get_instance_private (GXmlDouble* self)
{
	return G_STRUCT_MEMBER_P (self, GXmlDouble_private_offset);
}

static gchar*
gxml_double_real_get_value (GXmlBaseProperty* base)
{
	gchar* result;
	GXmlDouble* self;
	gchar* s = NULL;
	guint _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	self = (GXmlDouble*) base;
	_tmp0_ = self->priv->_decimals;
	_tmp1_ = g_strdup_printf ("%u", _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat ("%.", _tmp2_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strconcat (_tmp4_, "f", NULL);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	s = _tmp6_;
	_tmp7_ = g_strdup_printf (s, self->_value);
	result = _tmp7_;
	_g_free0 (s);
	return result;
}

static gdouble
double_parse (const gchar* str)
{
	gdouble result;
	g_return_val_if_fail (str != NULL, -1.0);
	result = g_ascii_strtod (str, NULL);
	return result;
}

static void
gxml_double_real_set_value (GXmlBaseProperty* base,
                            const gchar* value)
{
	GXmlDouble* self;
	self = (GXmlDouble*) base;
	self->_value = double_parse (value);
	g_object_notify_by_pspec ((GObject *) self, gxml_double_properties[GXML_DOUBLE_VALUE_PROPERTY]);
}

guint
gxml_double_get_decimals (GXmlDouble* self)
{
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	result = self->priv->_decimals;
	return result;
}

void
gxml_double_set_decimals (GXmlDouble* self,
                          guint value)
{
	guint old_value;
	g_return_if_fail (self != NULL);
	old_value = gxml_double_get_decimals (self);
	if (old_value != value) {
		self->priv->_decimals = value;
		g_object_notify_by_pspec ((GObject *) self, gxml_double_properties[GXML_DOUBLE_DECIMALS_PROPERTY]);
	}
}

/**
   * Retrieve current value.
   */
gdouble
gxml_double_get_double (GXmlDouble* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->_value;
	return result;
}

/**
   * Sets current value.
   */
void
gxml_double_set_double (GXmlDouble* self,
                        gdouble value)
{
	g_return_if_fail (self != NULL);
	self->_value = value;
}

GXmlDouble*
gxml_double_construct (GType object_type)
{
	GXmlDouble * self = NULL;
	self = (GXmlDouble*) gxml_base_property_construct (object_type);
	return self;
}

GXmlDouble*
gxml_double_new (void)
{
	return gxml_double_construct (GXML_TYPE_DOUBLE);
}

static void
gxml_double_class_init (GXmlDoubleClass * klass,
                        gpointer klass_data)
{
	gxml_double_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GXmlDouble_private_offset);
	GXML_BASE_PROPERTY_CLASS (klass)->get_value = (gchar* (*) (GXmlBaseProperty*)) gxml_double_real_get_value;
	GXML_BASE_PROPERTY_CLASS (klass)->set_value = (void (*) (GXmlBaseProperty*, const gchar*)) gxml_double_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_double_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_double_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_double_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_DOUBLE_VALUE_PROPERTY, gxml_double_properties[GXML_DOUBLE_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * Set number of decimals to write out as {@link Element}'s property.
	   * Default is 4.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_DOUBLE_DECIMALS_PROPERTY, gxml_double_properties[GXML_DOUBLE_DECIMALS_PROPERTY] = g_param_spec_uint ("decimals", "decimals", "decimals", 0, G_MAXUINT, (guint) 4, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_double_instance_init (GXmlDouble * self,
                           gpointer klass)
{
	self->priv = gxml_double_get_instance_private (self);
	self->_value = 0.0;
	self->priv->_decimals = (guint) 4;
}

static void
gxml_double_finalize (GObject * obj)
{
	GXmlDouble * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_DOUBLE, GXmlDouble);
	G_OBJECT_CLASS (gxml_double_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle {@link Element}'s attributes
 * using double precision floats as sources of values.
 *
 * Property is represented as a string.
 */
static GType
gxml_double_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlDoubleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_double_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlDouble), 0, (GInstanceInitFunc) gxml_double_instance_init, NULL };
	GType gxml_double_type_id;
	gxml_double_type_id = g_type_register_static (GXML_TYPE_BASE_PROPERTY, "GXmlDouble", &g_define_type_info, 0);
	GXmlDouble_private_offset = g_type_add_instance_private (gxml_double_type_id, sizeof (GXmlDoublePrivate));
	return gxml_double_type_id;
}

GType
gxml_double_get_type (void)
{
	static volatile gsize gxml_double_type_id__once = 0;
	if (g_once_init_enter (&gxml_double_type_id__once)) {
		GType gxml_double_type_id;
		gxml_double_type_id = gxml_double_get_type_once ();
		g_once_init_leave (&gxml_double_type_id__once, gxml_double_type_id);
	}
	return gxml_double_type_id__once;
}

static void
_vala_gxml_double_get_property (GObject * object,
                                guint property_id,
                                GValue * value,
                                GParamSpec * pspec)
{
	GXmlDouble * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_DOUBLE, GXmlDouble);
	switch (property_id) {
		case GXML_DOUBLE_VALUE_PROPERTY:
		g_value_take_string (value, gxml_base_property_get_value ((GXmlBaseProperty*) self));
		break;
		case GXML_DOUBLE_DECIMALS_PROPERTY:
		g_value_set_uint (value, gxml_double_get_decimals (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_double_set_property (GObject * object,
                                guint property_id,
                                const GValue * value,
                                GParamSpec * pspec)
{
	GXmlDouble * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_DOUBLE, GXmlDouble);
	switch (property_id) {
		case GXML_DOUBLE_VALUE_PROPERTY:
		gxml_base_property_set_value ((GXmlBaseProperty*) self, g_value_get_string (value));
		break;
		case GXML_DOUBLE_DECIMALS_PROPERTY:
		gxml_double_set_decimals (self, g_value_get_uint (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

/**
   * Retrieve current value.
   */
gfloat
gxml_float_get_float (GXmlFloat* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = (gfloat) ((GXmlDouble*) self)->_value;
	return result;
}

/**
   * Sets current value.
   */
void
gxml_float_set_float (GXmlFloat* self,
                      gfloat value)
{
	g_return_if_fail (self != NULL);
	((GXmlDouble*) self)->_value = (gdouble) value;
}

GXmlFloat*
gxml_float_construct (GType object_type)
{
	GXmlFloat * self = NULL;
	self = (GXmlFloat*) gxml_double_construct (object_type);
	return self;
}

GXmlFloat*
gxml_float_new (void)
{
	return gxml_float_construct (GXML_TYPE_FLOAT);
}

static void
gxml_float_class_init (GXmlFloatClass * klass,
                       gpointer klass_data)
{
	gxml_float_parent_class = g_type_class_peek_parent (klass);
}

static void
gxml_float_instance_init (GXmlFloat * self,
                          gpointer klass)
{
}

/**
 * Convenient class to handle {@link Element}'s attributes
 * using floats as sources of values.
 *
 * Property is represented as a string.
 */
static GType
gxml_float_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlFloatClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_float_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlFloat), 0, (GInstanceInitFunc) gxml_float_instance_init, NULL };
	GType gxml_float_type_id;
	gxml_float_type_id = g_type_register_static (GXML_TYPE_DOUBLE, "GXmlFloat", &g_define_type_info, 0);
	return gxml_float_type_id;
}

GType
gxml_float_get_type (void)
{
	static volatile gsize gxml_float_type_id__once = 0;
	if (g_once_init_enter (&gxml_float_type_id__once)) {
		GType gxml_float_type_id;
		gxml_float_type_id = gxml_float_get_type_once ();
		g_once_init_leave (&gxml_float_type_id__once, gxml_float_type_id);
	}
	return gxml_float_type_id__once;
}

static gchar*
gxml_int_real_get_value (GXmlBaseProperty* base)
{
	gchar* result;
	GXmlInt* self;
	gchar* _tmp0_;
	self = (GXmlInt*) base;
	_tmp0_ = g_strdup_printf ("%i", self->_value);
	result = _tmp0_;
	return result;
}

static void
gxml_int_real_set_value (GXmlBaseProperty* base,
                         const gchar* value)
{
	GXmlInt* self;
	self = (GXmlInt*) base;
	self->_value = (gint) double_parse (value);
	g_object_notify_by_pspec ((GObject *) self, gxml_int_properties[GXML_INT_VALUE_PROPERTY]);
}

/**
   * Retrieve current value.
   */
gint
gxml_int_get_integer (GXmlInt* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->_value;
	return result;
}

/**
   * Sets current value.
   */
void
gxml_int_set_integer (GXmlInt* self,
                      gint value)
{
	g_return_if_fail (self != NULL);
	self->_value = value;
}

GXmlInt*
gxml_int_construct (GType object_type)
{
	GXmlInt * self = NULL;
	self = (GXmlInt*) gxml_base_property_construct (object_type);
	return self;
}

GXmlInt*
gxml_int_new (void)
{
	return gxml_int_construct (GXML_TYPE_INT);
}

static void
gxml_int_class_init (GXmlIntClass * klass,
                     gpointer klass_data)
{
	gxml_int_parent_class = g_type_class_peek_parent (klass);
	GXML_BASE_PROPERTY_CLASS (klass)->get_value = (gchar* (*) (GXmlBaseProperty*)) gxml_int_real_get_value;
	GXML_BASE_PROPERTY_CLASS (klass)->set_value = (void (*) (GXmlBaseProperty*, const gchar*)) gxml_int_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_int_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_int_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_int_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_INT_VALUE_PROPERTY, gxml_int_properties[GXML_INT_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_int_instance_init (GXmlInt * self,
                        gpointer klass)
{
	self->_value = 0;
}

static void
gxml_int_finalize (GObject * obj)
{
	GXmlInt * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_INT, GXmlInt);
	G_OBJECT_CLASS (gxml_int_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle {@link Element}'s attributes
 * using a integers as sources of values.
 *
 * Property is represented as a string.
 */
static GType
gxml_int_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlIntClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_int_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlInt), 0, (GInstanceInitFunc) gxml_int_instance_init, NULL };
	GType gxml_int_type_id;
	gxml_int_type_id = g_type_register_static (GXML_TYPE_BASE_PROPERTY, "GXmlInt", &g_define_type_info, 0);
	return gxml_int_type_id;
}

GType
gxml_int_get_type (void)
{
	static volatile gsize gxml_int_type_id__once = 0;
	if (g_once_init_enter (&gxml_int_type_id__once)) {
		GType gxml_int_type_id;
		gxml_int_type_id = gxml_int_get_type_once ();
		g_once_init_leave (&gxml_int_type_id__once, gxml_int_type_id);
	}
	return gxml_int_type_id__once;
}

static void
_vala_gxml_int_get_property (GObject * object,
                             guint property_id,
                             GValue * value,
                             GParamSpec * pspec)
{
	GXmlInt * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_INT, GXmlInt);
	switch (property_id) {
		case GXML_INT_VALUE_PROPERTY:
		g_value_take_string (value, gxml_base_property_get_value ((GXmlBaseProperty*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_int_set_property (GObject * object,
                             guint property_id,
                             const GValue * value,
                             GParamSpec * pspec)
{
	GXmlInt * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_INT, GXmlInt);
	switch (property_id) {
		case GXML_INT_VALUE_PROPERTY:
		gxml_base_property_set_value ((GXmlBaseProperty*) self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static gchar*
gxml_boolean_real_get_value (GXmlBaseProperty* base)
{
	gchar* result;
	GXmlBoolean* self;
	gchar* _tmp0_;
	self = (GXmlBoolean*) base;
	_tmp0_ = bool_to_string (self->_value);
	result = _tmp0_;
	return result;
}

static gboolean
bool_parse (const gchar* str)
{
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	if (g_strcmp0 (str, "true") == 0) {
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

static void
gxml_boolean_real_set_value (GXmlBaseProperty* base,
                             const gchar* value)
{
	GXmlBoolean* self;
	self = (GXmlBoolean*) base;
	self->_value = bool_parse (value);
	g_object_notify_by_pspec ((GObject *) self, gxml_boolean_properties[GXML_BOOLEAN_VALUE_PROPERTY]);
}

/**
   * Retrieve current value.
   */
gboolean
gxml_boolean_get_boolean (GXmlBoolean* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->_value;
	return result;
}

/**
   * Sets current value.
   */
void
gxml_boolean_set_boolean (GXmlBoolean* self,
                          gboolean value)
{
	g_return_if_fail (self != NULL);
	self->_value = value;
}

GXmlBoolean*
gxml_boolean_construct (GType object_type)
{
	GXmlBoolean * self = NULL;
	self = (GXmlBoolean*) gxml_base_property_construct (object_type);
	return self;
}

GXmlBoolean*
gxml_boolean_new (void)
{
	return gxml_boolean_construct (GXML_TYPE_BOOLEAN);
}

static void
gxml_boolean_class_init (GXmlBooleanClass * klass,
                         gpointer klass_data)
{
	gxml_boolean_parent_class = g_type_class_peek_parent (klass);
	GXML_BASE_PROPERTY_CLASS (klass)->get_value = (gchar* (*) (GXmlBaseProperty*)) gxml_boolean_real_get_value;
	GXML_BASE_PROPERTY_CLASS (klass)->set_value = (void (*) (GXmlBaseProperty*, const gchar*)) gxml_boolean_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_boolean_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_boolean_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_boolean_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_BOOLEAN_VALUE_PROPERTY, gxml_boolean_properties[GXML_BOOLEAN_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_boolean_instance_init (GXmlBoolean * self,
                            gpointer klass)
{
	self->_value = FALSE;
}

static void
gxml_boolean_finalize (GObject * obj)
{
	GXmlBoolean * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_BOOLEAN, GXmlBoolean);
	G_OBJECT_CLASS (gxml_boolean_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle {@link Element}'s attributes
 * using a boolean ('true' and 'false') as sources of values.
 *
 * Property is represented as a string, using 'true' or 'false'.
 */
static GType
gxml_boolean_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlBooleanClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_boolean_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlBoolean), 0, (GInstanceInitFunc) gxml_boolean_instance_init, NULL };
	GType gxml_boolean_type_id;
	gxml_boolean_type_id = g_type_register_static (GXML_TYPE_BASE_PROPERTY, "GXmlBoolean", &g_define_type_info, 0);
	return gxml_boolean_type_id;
}

GType
gxml_boolean_get_type (void)
{
	static volatile gsize gxml_boolean_type_id__once = 0;
	if (g_once_init_enter (&gxml_boolean_type_id__once)) {
		GType gxml_boolean_type_id;
		gxml_boolean_type_id = gxml_boolean_get_type_once ();
		g_once_init_leave (&gxml_boolean_type_id__once, gxml_boolean_type_id);
	}
	return gxml_boolean_type_id__once;
}

static void
_vala_gxml_boolean_get_property (GObject * object,
                                 guint property_id,
                                 GValue * value,
                                 GParamSpec * pspec)
{
	GXmlBoolean * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_BOOLEAN, GXmlBoolean);
	switch (property_id) {
		case GXML_BOOLEAN_VALUE_PROPERTY:
		g_value_take_string (value, gxml_base_property_get_value ((GXmlBaseProperty*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_boolean_set_property (GObject * object,
                                 guint property_id,
                                 const GValue * value,
                                 GParamSpec * pspec)
{
	GXmlBoolean * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_BOOLEAN, GXmlBoolean);
	switch (property_id) {
		case GXML_BOOLEAN_VALUE_PROPERTY:
		gxml_base_property_set_value ((GXmlBaseProperty*) self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
gxml_enum_get_instance_private (GXmlEnum* self)
{
	return G_STRUCT_MEMBER_P (self, GXmlEnum_private_offset);
}

gboolean
gxml_enum_get_use_nick (GXmlEnum* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_use_nick;
	return result;
}

void
gxml_enum_set_use_nick (GXmlEnum* self,
                        gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gxml_enum_get_use_nick (self);
	if (old_value != value) {
		self->priv->_use_nick = value;
		g_object_notify_by_pspec ((GObject *) self, gxml_enum_properties[GXML_ENUM_USE_NICK_PROPERTY]);
	}
}

gboolean
gxml_enum_get_camel_case (GXmlEnum* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_camel_case;
	return result;
}

void
gxml_enum_set_camel_case (GXmlEnum* self,
                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gxml_enum_get_camel_case (self);
	if (old_value != value) {
		self->priv->_camel_case = value;
		g_object_notify_by_pspec ((GObject *) self, gxml_enum_properties[GXML_ENUM_CAMEL_CASE_PROPERTY]);
	}
}

gboolean
gxml_enum_get_upper_case (GXmlEnum* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_upper_case;
	return result;
}

void
gxml_enum_set_upper_case (GXmlEnum* self,
                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = gxml_enum_get_upper_case (self);
	if (old_value != value) {
		self->priv->_upper_case = value;
		g_object_notify_by_pspec ((GObject *) self, gxml_enum_properties[GXML_ENUM_UPPER_CASE_PROPERTY]);
	}
}

static gchar*
gxml_enum_real_get_value (GXmlBaseProperty* base)
{
	gchar* result;
	GXmlEnum* self;
	const gchar* _tmp0_;
	gchar* s = NULL;
	gchar* _tmp3_;
	GError* _inner_error0_ = NULL;
	self = (GXmlEnum*) base;
	_tmp0_ = self->_val;
	if (_tmp0_ != NULL) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->_val;
		_tmp2_ = g_strdup (_tmp1_);
		result = _tmp2_;
		return result;
	}
	_tmp3_ = g_strdup ("");
	s = _tmp3_;
	{
		gboolean _tmp4_;
		_tmp4_ = self->priv->_use_nick;
		if (_tmp4_) {
			gboolean _tmp5_;
			gboolean _tmp16_;
			_tmp5_ = self->priv->_camel_case;
			if (_tmp5_) {
				gchar* _tmp6_ = NULL;
				GType _tmp7_;
				GType _tmp8_;
				gchar* _tmp9_;
				gchar* _tmp10_;
				_tmp7_ = gxml_enum_get_enum_type (self);
				_tmp8_ = _tmp7_;
				_tmp9_ = gxml_enumeration_get_nick_camelcase (_tmp8_, self->_value, &_inner_error0_);
				_tmp6_ = _tmp9_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp10_ = _tmp6_;
				_tmp6_ = NULL;
				_g_free0 (s);
				s = _tmp10_;
				_g_free0 (_tmp6_);
			} else {
				gchar* _tmp11_ = NULL;
				GType _tmp12_;
				GType _tmp13_;
				gchar* _tmp14_;
				gchar* _tmp15_;
				_tmp12_ = gxml_enum_get_enum_type (self);
				_tmp13_ = _tmp12_;
				_tmp14_ = gxml_enumeration_get_nick (_tmp13_, self->_value, &_inner_error0_);
				_tmp11_ = _tmp14_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp15_ = _tmp11_;
				_tmp11_ = NULL;
				_g_free0 (s);
				s = _tmp15_;
				_g_free0 (_tmp11_);
			}
			_tmp16_ = self->priv->_upper_case;
			if (_tmp16_) {
				const gchar* _tmp17_;
				gchar* _tmp18_;
				_tmp17_ = s;
				_tmp18_ = g_utf8_strup (_tmp17_, (gssize) -1);
				_g_free0 (s);
				s = _tmp18_;
			}
		} else {
			gchar* _tmp19_ = NULL;
			GType _tmp20_;
			GType _tmp21_;
			gchar* _tmp22_;
			gchar* _tmp23_;
			gboolean _tmp24_;
			_tmp20_ = gxml_enum_get_enum_type (self);
			_tmp21_ = _tmp20_;
			_tmp22_ = gxml_enumeration_get_string (_tmp21_, self->_value, FALSE, FALSE, &_inner_error0_);
			_tmp19_ = _tmp22_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp23_ = _tmp19_;
			_tmp19_ = NULL;
			_g_free0 (s);
			s = _tmp23_;
			_tmp24_ = self->priv->_upper_case;
			if (!_tmp24_) {
				const gchar* _tmp25_;
				gchar* _tmp26_;
				_tmp25_ = s;
				_tmp26_ = g_utf8_strdown (_tmp25_, (gssize) -1);
				_g_free0 (s);
				s = _tmp26_;
			}
			_g_free0 (_tmp19_);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp27_;
		const gchar* _tmp28_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp27_ = e;
		_tmp28_ = _tmp27_->message;
		g_warning (_ ("Error when transform enum to attribute's value: %s"), _tmp28_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (s);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = s;
	return result;
}

static void
gxml_enum_real_set_value (GXmlBaseProperty* base,
                          const gchar* value)
{
	GXmlEnum* self;
	GError* _inner_error0_ = NULL;
	self = (GXmlEnum*) base;
	{
		GEnumValue* _tmp0_ = NULL;
		GType _tmp1_;
		GType _tmp2_;
		GEnumValue* _tmp3_;
		_tmp1_ = gxml_enum_get_enum_type (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = gxml_enumeration_parse (_tmp2_, value, &_inner_error0_);
		_tmp0_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		self->_value = (gint) (*_tmp0_).value;
		_g_free0 (self->_val);
		self->_val = NULL;
		_g_free0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_message (_ ("Error when transform from attribute string value to enum: %s"), _tmp5_);
		_tmp6_ = g_strdup (value);
		_g_free0 (self->_val);
		self->_val = _tmp6_;
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	g_object_notify_by_pspec ((GObject *) self, gxml_enum_properties[GXML_ENUM_VALUE_PROPERTY]);
}

GType
gxml_enum_get_enum_type (GXmlEnum* self)
{
	GType result;
	g_return_val_if_fail (self != NULL, G_TYPE_INVALID);
	result = self->_enum_type;
	return result;
}

void
gxml_enum_set_enum_type (GXmlEnum* self,
                         GType value)
{
	g_return_if_fail (self != NULL);
	self->_enum_type = value;
	g_object_notify_by_pspec ((GObject *) self, gxml_enum_properties[GXML_ENUM_ENUM_TYPE_PROPERTY]);
}

/**
   * Convenient method to initialize internal enum type.
   */
void
gxml_enum_initialize_enum (GXmlEnum* self,
                           GType enum_type)
{
	g_return_if_fail (self != NULL);
	self->_enum_type = enum_type;
}

/**
   * Retrieve current value.
   */
gint
gxml_enum_get_enum (GXmlEnum* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = (gint) self->_value;
	return result;
}

/**
   * Sets current value.
   */
void
gxml_enum_set_enum (GXmlEnum* self,
                    gint value)
{
	g_return_if_fail (self != NULL);
	self->_value = value;
}

/**
   *
   */
gboolean
gxml_enum_is_valid (GXmlEnum* self)
{
	const gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->_val;
	result = _tmp0_ == NULL;
	return result;
}

GXmlEnum*
gxml_enum_construct (GType object_type)
{
	GXmlEnum * self = NULL;
	self = (GXmlEnum*) gxml_base_property_construct (object_type);
	return self;
}

GXmlEnum*
gxml_enum_new (void)
{
	return gxml_enum_construct (GXML_TYPE_ENUM);
}

static GObject *
gxml_enum_constructor (GType type,
                       guint n_construct_properties,
                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GXmlEnum * self;
	parent_class = G_OBJECT_CLASS (gxml_enum_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_ENUM, GXmlEnum);
	gxml_enum_set_use_nick (self, TRUE);
	gxml_enum_set_camel_case (self, FALSE);
	gxml_enum_set_upper_case (self, FALSE);
	return obj;
}

static void
gxml_enum_class_init (GXmlEnumClass * klass,
                      gpointer klass_data)
{
	gxml_enum_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GXmlEnum_private_offset);
	GXML_BASE_PROPERTY_CLASS (klass)->get_value = (gchar* (*) (GXmlBaseProperty*)) gxml_enum_real_get_value;
	GXML_BASE_PROPERTY_CLASS (klass)->set_value = (void (*) (GXmlBaseProperty*, const gchar*)) gxml_enum_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_enum_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_enum_set_property;
	G_OBJECT_CLASS (klass)->constructor = gxml_enum_constructor;
	G_OBJECT_CLASS (klass)->finalize = gxml_enum_finalize;
	/**
	   * Introspect the enumeration and use its nick to produce the value. Defaults to TRUE.
	   *
	   * An enum declared as 'ENUM_VALUE', its value is converted to 'enum-value'. Without
	   * this option the output is a complete name definition as declared by GLib.
	   *
	   * An enum value like : Myenum.ENUM_VALUE, is converted to 'enum-value' if no {@link camel_case}
	   * is enable and {@link use_nick} is enable; to 'EnumValue' if {@link camel_case} is true and
	   * {@link use_nick} is enable; and to 'MYENUM_ENUM_VALUE' if {@link use_nick} is set to false.
	   *
	   * An enum value like : Myenum.VALUE, is converted to 'value' if if no {@link camel_case}
	   * is enable; to 'Value' if  if no {@link camel_case} is enable; and to 'MYENUM_VALUE'
	   * if {@link use_nick} is set to false.
	   *
	   * The value can be converted to upper cases if {@link upper_case} is set to true.
	   *
	   * If  {@link use_nick} is set to false and {@link upper_case} is set to false, the value
	   * will be the lower case of the GLib default representation. For Myenum.ENUM_VALUE, the
	   * value will be 'myenum_enum_value'. Set {@link upper_case} to true, to keep the default
	   * GLib upper cases representation.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_ENUM_USE_NICK_PROPERTY, gxml_enum_properties[GXML_ENUM_USE_NICK_PROPERTY] = g_param_spec_boolean ("use-nick", "use-nick", "use-nick", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	/**
	   * Tries to convert the value to CamelCase using its nick non canonical name. Defaults to FALSE.
	   *
	   * An enum declared as 'ENUM_VALUE', its value is converted to 'EnumValue'. See
	   * {@link use_nick} for details.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_ENUM_CAMEL_CASE_PROPERTY, gxml_enum_properties[GXML_ENUM_CAMEL_CASE_PROPERTY] = g_param_spec_boolean ("camel-case", "camel-case", "camel-case", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	/**
	   * The value output, is always converted to upper cases. See
	   * {@link use_nick} for details.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_ENUM_UPPER_CASE_PROPERTY, gxml_enum_properties[GXML_ENUM_UPPER_CASE_PROPERTY] = g_param_spec_boolean ("upper-case", "upper-case", "upper-case", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_ENUM_VALUE_PROPERTY, gxml_enum_properties[GXML_ENUM_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	   * Enum type used by property.
	   */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_ENUM_ENUM_TYPE_PROPERTY, gxml_enum_properties[GXML_ENUM_ENUM_TYPE_PROPERTY] = g_param_spec_gtype ("enum-type", "enum-type", "enum-type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
}

static void
gxml_enum_instance_init (GXmlEnum * self,
                         gpointer klass)
{
	self->priv = gxml_enum_get_instance_private (self);
	self->_value = 0;
	self->_val = NULL;
}

static void
gxml_enum_finalize (GObject * obj)
{
	GXmlEnum * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_ENUM, GXmlEnum);
	_g_free0 (self->_val);
	G_OBJECT_CLASS (gxml_enum_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle {@link Element}'s attributes
 * using a {@link GLib.Type.ENUM} as a source of values.
 *
 * Enumeration is represented as a string, using its name, independent of
 * value position in enumeration.
 */
static GType
gxml_enum_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlEnumClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_enum_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlEnum), 0, (GInstanceInitFunc) gxml_enum_instance_init, NULL };
	GType gxml_enum_type_id;
	gxml_enum_type_id = g_type_register_static (GXML_TYPE_BASE_PROPERTY, "GXmlEnum", &g_define_type_info, 0);
	GXmlEnum_private_offset = g_type_add_instance_private (gxml_enum_type_id, sizeof (GXmlEnumPrivate));
	return gxml_enum_type_id;
}

GType
gxml_enum_get_type (void)
{
	static volatile gsize gxml_enum_type_id__once = 0;
	if (g_once_init_enter (&gxml_enum_type_id__once)) {
		GType gxml_enum_type_id;
		gxml_enum_type_id = gxml_enum_get_type_once ();
		g_once_init_leave (&gxml_enum_type_id__once, gxml_enum_type_id);
	}
	return gxml_enum_type_id__once;
}

static void
_vala_gxml_enum_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec)
{
	GXmlEnum * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_ENUM, GXmlEnum);
	switch (property_id) {
		case GXML_ENUM_USE_NICK_PROPERTY:
		g_value_set_boolean (value, gxml_enum_get_use_nick (self));
		break;
		case GXML_ENUM_CAMEL_CASE_PROPERTY:
		g_value_set_boolean (value, gxml_enum_get_camel_case (self));
		break;
		case GXML_ENUM_UPPER_CASE_PROPERTY:
		g_value_set_boolean (value, gxml_enum_get_upper_case (self));
		break;
		case GXML_ENUM_VALUE_PROPERTY:
		g_value_take_string (value, gxml_base_property_get_value ((GXmlBaseProperty*) self));
		break;
		case GXML_ENUM_ENUM_TYPE_PROPERTY:
		g_value_set_gtype (value, gxml_enum_get_enum_type (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_enum_set_property (GObject * object,
                              guint property_id,
                              const GValue * value,
                              GParamSpec * pspec)
{
	GXmlEnum * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_ENUM, GXmlEnum);
	switch (property_id) {
		case GXML_ENUM_USE_NICK_PROPERTY:
		gxml_enum_set_use_nick (self, g_value_get_boolean (value));
		break;
		case GXML_ENUM_CAMEL_CASE_PROPERTY:
		gxml_enum_set_camel_case (self, g_value_get_boolean (value));
		break;
		case GXML_ENUM_UPPER_CASE_PROPERTY:
		gxml_enum_set_upper_case (self, g_value_get_boolean (value));
		break;
		case GXML_ENUM_VALUE_PROPERTY:
		gxml_base_property_set_value ((GXmlBaseProperty*) self, g_value_get_string (value));
		break;
		case GXML_ENUM_ENUM_TYPE_PROPERTY:
		gxml_enum_set_enum_type (self, g_value_get_gtype (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static gchar*
gxml_date_real_get_value (GXmlBaseProperty* base)
{
	gchar* result;
	GXmlDate* self;
	gchar* fr = NULL;
	gchar* _tmp0_;
	gint fr_length1;
	gint _fr_size_;
	gchar* _tmp1_;
	gint _tmp1__length1;
	gchar* _tmp2_;
	gint _tmp2__length1;
	gchar* _tmp3_;
	self = (GXmlDate*) base;
	if (!g_date_valid (&self->_value)) {
		result = NULL;
		return result;
	}
	_tmp0_ = g_new0 (gchar, 100);
	fr = _tmp0_;
	fr_length1 = 100;
	_fr_size_ = fr_length1;
	_tmp1_ = fr;
	_tmp1__length1 = fr_length1;
	g_date_strftime (_tmp1_, (gint) _tmp1__length1, "%Y-%m-%d", &self->_value);
	_tmp2_ = fr;
	_tmp2__length1 = fr_length1;
	_tmp3_ = g_strdup ((const gchar*) _tmp2_);
	result = _tmp3_;
	fr = (g_free (fr), NULL);
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static void
gxml_date_real_set_value (GXmlBaseProperty* base,
                          const gchar* value)
{
	GXmlDate* self;
	self = (GXmlDate*) base;
	memset (&self->_value, 0, sizeof (GDate));
	if (string_contains (value, "-")) {
		gchar** dp = NULL;
		gchar** _tmp0_;
		gchar** _tmp1_;
		gint dp_length1;
		gint _dp_size_;
		gchar** _tmp2_;
		gint _tmp2__length1;
		_tmp1_ = _tmp0_ = g_strsplit (value, "-", 0);
		dp = _tmp1_;
		dp_length1 = _vala_array_length (_tmp0_);
		_dp_size_ = dp_length1;
		_tmp2_ = dp;
		_tmp2__length1 = dp_length1;
		if (_tmp2__length1 == 3) {
			gint y = 0;
			gchar** _tmp3_;
			gint _tmp3__length1;
			const gchar* _tmp4_;
			gint m = 0;
			gchar** _tmp5_;
			gint _tmp5__length1;
			const gchar* _tmp6_;
			gint d = 0;
			gchar** _tmp7_;
			gint _tmp7__length1;
			const gchar* _tmp8_;
			_tmp3_ = dp;
			_tmp3__length1 = dp_length1;
			_tmp4_ = _tmp3_[0];
			y = atoi (_tmp4_);
			_tmp5_ = dp;
			_tmp5__length1 = dp_length1;
			_tmp6_ = _tmp5_[1];
			m = atoi (_tmp6_);
			_tmp7_ = dp;
			_tmp7__length1 = dp_length1;
			_tmp8_ = _tmp7_[2];
			d = atoi (_tmp8_);
			g_date_set_dmy (&self->_value, (GDateDay) d, (gint) ((GDateMonth) m), (GDateYear) y);
			if (!g_date_valid (&self->_value)) {
				gchar* _tmp9_;
				gchar* _tmp10_;
				_tmp9_ = g_strconcat ("Invalid Date for property: ", value, NULL);
				_tmp10_ = _tmp9_;
				g_warning ("Property.vala:462: %s", _ (_tmp10_));
				_g_free0 (_tmp10_);
			}
		} else {
			gchar* _tmp11_;
			gchar* _tmp12_;
			_tmp11_ = g_strconcat ("Invalid format for Date property: ", value, NULL);
			_tmp12_ = _tmp11_;
			g_warning ("Property.vala:464: %s", _ (_tmp12_));
			_g_free0 (_tmp12_);
		}
		dp = (_vala_array_free (dp, dp_length1, (GDestroyNotify) g_free), NULL);
	} else {
		g_date_set_parse (&self->_value, value);
	}
	if (!g_date_valid (&self->_value)) {
		gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp13_ = g_strconcat ("Invalid Date for property: ", value, NULL);
		_tmp14_ = _tmp13_;
		g_warning ("Property.vala:469: %s", _ (_tmp14_));
		_g_free0 (_tmp14_);
	}
	g_object_notify_by_pspec ((GObject *) self, gxml_date_properties[GXML_DATE_VALUE_PROPERTY]);
}

/**
   * Retrieves current value.
   */
void
gxml_date_get_date (GXmlDate* self,
                    GDate* result)
{
	GDate _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->_value;
	*result = _tmp0_;
	return;
}

/**
   * Sets current value.
   */
void
gxml_date_set_date (GXmlDate* self,
                    GDate* date)
{
	GDate _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (date != NULL);
	_tmp0_ = *date;
	self->_value = _tmp0_;
}

GXmlDate*
gxml_date_construct (GType object_type)
{
	GXmlDate * self = NULL;
	self = (GXmlDate*) gxml_base_property_construct (object_type);
	return self;
}

GXmlDate*
gxml_date_new (void)
{
	return gxml_date_construct (GXML_TYPE_DATE);
}

static void
gxml_date_class_init (GXmlDateClass * klass,
                      gpointer klass_data)
{
	gxml_date_parent_class = g_type_class_peek_parent (klass);
	GXML_BASE_PROPERTY_CLASS (klass)->get_value = (gchar* (*) (GXmlBaseProperty*)) gxml_date_real_get_value;
	GXML_BASE_PROPERTY_CLASS (klass)->set_value = (void (*) (GXmlBaseProperty*, const gchar*)) gxml_date_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_date_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_date_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_date_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_DATE_VALUE_PROPERTY, gxml_date_properties[GXML_DATE_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_date_instance_init (GXmlDate * self,
                         gpointer klass)
{
	memset (&self->_value, 0, sizeof (GDate));
}

static void
gxml_date_finalize (GObject * obj)
{
	GXmlDate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_DATE, GXmlDate);
	G_OBJECT_CLASS (gxml_date_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle {@link Element}'s attributes
 * using a {@link GLib.Date} as sources of values.
 *
 * Property is represented as a string using a %Y-%m-%d format
 */
static GType
gxml_date_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlDateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_date_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlDate), 0, (GInstanceInitFunc) gxml_date_instance_init, NULL };
	GType gxml_date_type_id;
	gxml_date_type_id = g_type_register_static (GXML_TYPE_BASE_PROPERTY, "GXmlDate", &g_define_type_info, 0);
	return gxml_date_type_id;
}

GType
gxml_date_get_type (void)
{
	static volatile gsize gxml_date_type_id__once = 0;
	if (g_once_init_enter (&gxml_date_type_id__once)) {
		GType gxml_date_type_id;
		gxml_date_type_id = gxml_date_get_type_once ();
		g_once_init_leave (&gxml_date_type_id__once, gxml_date_type_id);
	}
	return gxml_date_type_id__once;
}

static void
_vala_gxml_date_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec)
{
	GXmlDate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_DATE, GXmlDate);
	switch (property_id) {
		case GXML_DATE_VALUE_PROPERTY:
		g_value_take_string (value, gxml_base_property_get_value ((GXmlBaseProperty*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_date_set_property (GObject * object,
                              guint property_id,
                              const GValue * value,
                              GParamSpec * pspec)
{
	GXmlDate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_DATE, GXmlDate);
	switch (property_id) {
		case GXML_DATE_VALUE_PROPERTY:
		gxml_base_property_set_value ((GXmlBaseProperty*) self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
gxml_date_time_get_instance_private (GXmlDateTime* self)
{
	return G_STRUCT_MEMBER_P (self, GXmlDateTime_private_offset);
}

const gchar*
gxml_date_time_get_format (GXmlDateTime* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_format;
	result = _tmp0_;
	return result;
}

void
gxml_date_time_set_format (GXmlDateTime* self,
                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = gxml_date_time_get_format (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_format);
		self->priv->_format = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, gxml_date_time_properties[GXML_DATE_TIME_FORMAT_PROPERTY]);
	}
}

static gchar*
gxml_date_time_real_get_value (GXmlBaseProperty* base)
{
	gchar* result;
	GXmlDateTime* self;
	GDateTime* _tmp0_;
	gchar* s = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	GDateTime* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	self = (GXmlDateTime*) base;
	_tmp0_ = self->_value;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->_format;
	_tmp2_ = g_strdup (_tmp1_);
	s = _tmp2_;
	_tmp3_ = s;
	if (_tmp3_ == NULL) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup ("%FT%T");
		_g_free0 (s);
		s = _tmp4_;
	}
	_tmp5_ = self->_value;
	_tmp6_ = s;
	_tmp7_ = g_date_time_format (_tmp5_, _tmp6_);
	result = _tmp7_;
	_g_free0 (s);
	return result;
}

static void
gxml_date_time_real_set_value (GXmlBaseProperty* base,
                               const gchar* value)
{
	GXmlDateTime* self;
	GTimeZone* tz = NULL;
	GTimeZone* _tmp0_;
	GDateTime* dt = NULL;
	GTimeZone* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	self = (GXmlDateTime*) base;
	_tmp0_ = g_time_zone_new_utc ();
	tz = _tmp0_;
	_tmp1_ = tz;
	_tmp2_ = g_date_time_new_from_iso8601 (value, _tmp1_);
	dt = _tmp2_;
	_tmp3_ = dt;
	if (_tmp3_ != NULL) {
		GDateTime* _tmp4_;
		GDateTime* _tmp5_;
		_tmp4_ = dt;
		_tmp5_ = g_date_time_add_days (_tmp4_, 0);
		_g_date_time_unref0 (self->_value);
		self->_value = _tmp5_;
	} else {
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp6_ = g_strconcat ("Invalid timestamp for property: ", value, NULL);
		_tmp7_ = _tmp6_;
		g_warning ("Property.vala:511: %s", _ (_tmp7_));
		_g_free0 (_tmp7_);
	}
	_g_date_time_unref0 (dt);
	_g_time_zone_unref0 (tz);
	g_object_notify_by_pspec ((GObject *) self, gxml_date_time_properties[GXML_DATE_TIME_VALUE_PROPERTY]);
}

/**
   * Retrieves current value.
   */
static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

GDateTime*
gxml_date_time_get_datetime (GXmlDateTime* self)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_value;
	_tmp1_ = _g_date_time_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

/**
   * Sets current value.
   */
void
gxml_date_time_set_datetime (GXmlDateTime* self,
                             GDateTime* dt)
{
	GDateTime* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dt != NULL);
	_tmp0_ = _g_date_time_ref0 (dt);
	_g_date_time_unref0 (self->_value);
	self->_value = _tmp0_;
}

GXmlDateTime*
gxml_date_time_construct (GType object_type)
{
	GXmlDateTime * self = NULL;
	self = (GXmlDateTime*) gxml_base_property_construct (object_type);
	return self;
}

GXmlDateTime*
gxml_date_time_new (void)
{
	return gxml_date_time_construct (GXML_TYPE_DATE_TIME);
}

static void
gxml_date_time_class_init (GXmlDateTimeClass * klass,
                           gpointer klass_data)
{
	gxml_date_time_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GXmlDateTime_private_offset);
	GXML_BASE_PROPERTY_CLASS (klass)->get_value = (gchar* (*) (GXmlBaseProperty*)) gxml_date_time_real_get_value;
	GXML_BASE_PROPERTY_CLASS (klass)->set_value = (void (*) (GXmlBaseProperty*, const gchar*)) gxml_date_time_real_set_value;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_date_time_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_date_time_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_date_time_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_DATE_TIME_FORMAT_PROPERTY, gxml_date_time_properties[GXML_DATE_TIME_FORMAT_PROPERTY] = g_param_spec_string ("format", "format", "format", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_DATE_TIME_VALUE_PROPERTY, gxml_date_time_properties[GXML_DATE_TIME_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
gxml_date_time_instance_init (GXmlDateTime * self,
                              gpointer klass)
{
	self->priv = gxml_date_time_get_instance_private (self);
	self->_value = NULL;
}

static void
gxml_date_time_finalize (GObject * obj)
{
	GXmlDateTime * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_DATE_TIME, GXmlDateTime);
	_g_date_time_unref0 (self->_value);
	_g_free0 (self->priv->_format);
	G_OBJECT_CLASS (gxml_date_time_parent_class)->finalize (obj);
}

/**
 * Convenient class to handle {@link Element}'s attributes
 * using a {@link GLib.DateTime} as sources of values.
 *
 * Timestamp is considered in UTC time.
 *
 * Property is represented as a string using a {@link DateTime.format}
 * and {@link GLib.DateTime.format} method. If {@link DateTime.format}
 * is not set '%FT%T' format is used by default.
 *
 * For limitations on text parsing, see at {@link GLib.DateTime.DateTime.from_iso8601}
 */
static GType
gxml_date_time_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlDateTimeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_date_time_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlDateTime), 0, (GInstanceInitFunc) gxml_date_time_instance_init, NULL };
	GType gxml_date_time_type_id;
	gxml_date_time_type_id = g_type_register_static (GXML_TYPE_BASE_PROPERTY, "GXmlDateTime", &g_define_type_info, 0);
	GXmlDateTime_private_offset = g_type_add_instance_private (gxml_date_time_type_id, sizeof (GXmlDateTimePrivate));
	return gxml_date_time_type_id;
}

GType
gxml_date_time_get_type (void)
{
	static volatile gsize gxml_date_time_type_id__once = 0;
	if (g_once_init_enter (&gxml_date_time_type_id__once)) {
		GType gxml_date_time_type_id;
		gxml_date_time_type_id = gxml_date_time_get_type_once ();
		g_once_init_leave (&gxml_date_time_type_id__once, gxml_date_time_type_id);
	}
	return gxml_date_time_type_id__once;
}

static void
_vala_gxml_date_time_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	GXmlDateTime * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_DATE_TIME, GXmlDateTime);
	switch (property_id) {
		case GXML_DATE_TIME_FORMAT_PROPERTY:
		g_value_set_string (value, gxml_date_time_get_format (self));
		break;
		case GXML_DATE_TIME_VALUE_PROPERTY:
		g_value_take_string (value, gxml_base_property_get_value ((GXmlBaseProperty*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_date_time_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	GXmlDateTime * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_DATE_TIME, GXmlDateTime);
	switch (property_id) {
		case GXML_DATE_TIME_FORMAT_PROPERTY:
		gxml_date_time_set_format (self, g_value_get_string (value));
		break;
		case GXML_DATE_TIME_VALUE_PROPERTY:
		gxml_base_property_set_value ((GXmlBaseProperty*) self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

