Midgard2 Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
MidgardReflectorPropertyMidgardReflectorProperty — Provides reflection routines for properties registered for MidgardDBObject derived classes. |
#include <midgard/midgard.h> struct MidgardReflectorProperty; MidgardReflectorProperty * midgard_reflector_property_new (const gchar *classname
); GType midgard_reflector_property_get_midgard_type (MidgardReflectorProperty *self
,const gchar *propname
); gboolean midgard_reflector_property_is_link (MidgardReflectorProperty *self
,const gchar *propname
); gboolean midgard_reflector_property_is_linked (MidgardReflectorProperty *self
,const gchar *propname
); const MidgardDBObjectClass * midgard_reflector_property_get_link_class (MidgardReflectorProperty *self
,const gchar *propname
); const gchar * midgard_reflector_property_get_link_name (MidgardReflectorProperty *self
,const gchar *propname
); const gchar * midgard_reflector_property_get_link_target (MidgardReflectorProperty *self
,const gchar *propname
); const gchar * midgard_reflector_property_description (MidgardReflectorProperty *self
,const gchar *propname
); const gchar * midgard_reflector_property_get_user_value (MidgardReflectorProperty *self
,const gchar *property
,const gchar *name
); gboolean midgard_reflector_property_is_private (MidgardReflectorProperty *self
,const gchar *property
); gboolean midgard_reflector_property_is_unique (MidgardReflectorProperty *self
,const gchar *property
); gboolean midgard_reflector_property_is_primary (MidgardReflectorProperty *self
,const gchar *property
); gboolean midgard_reflector_property_has_default_value (MidgardReflectorProperty *self
,const gchar *property
); GValue * midgard_reflector_property_get_default_value (MidgardReflectorProperty *self
,const gchar *property
);
Main purpose of this class is to provide reflection routines for any MidgardDBObject derived class' properties. Mainly, it's most usable for Midgard Schema classes defined in xml files (MidgardObject derived), but of course properties of any class which extends Midgard Schema one may be also reflected with MidgardReflectorProperty.
MidgardReflectorProperty * midgard_reflector_property_new
(const gchar *classname
);
|
Name of MidgardDBObject (or derived) class. [in] |
Returns : |
newly initialized MidgardReflectorProperty instance or NULL on failure. [transfer full]
|
Since 10.05
GType midgard_reflector_property_get_midgard_type (MidgardReflectorProperty *self
,const gchar *propname
);
|
MidgardReflectorProperty instance |
|
property name which is registered for MidgardDBObjectClass |
Returns : |
type (GType) of the property or NULL if property is not registered for given class. |
Since 10.05
gboolean midgard_reflector_property_is_link (MidgardReflectorProperty *self
,const gchar *propname
);
Checks whether property is a link.
|
MidgardReflectorProperty instance |
|
property name |
Returns : |
TRUE if property is registered as link, FALSE otherwise (or in case if property is not registered for given class. |
Since 10.05
gboolean midgard_reflector_property_is_linked (MidgardReflectorProperty *self
,const gchar *propname
);
Checks if property is linked with another type.
|
MidgardReflectorProperty instance |
|
property name |
Returns : |
TRUE if property is linked with another type (property of another class is defined as a link to given one).
FALSE is returned if property is not linked or is not registered for given class. |
Since 10.05
const MidgardDBObjectClass * midgard_reflector_property_get_link_class (MidgardReflectorProperty *self
,const gchar *propname
);
|
MidgardReflectorProperty instance |
|
property name |
Returns : |
the pointer to the MidgardDBObjectClass, a given property is a link to.
see midgard_reflector_property_get_link_name()
|
Since 10.05
const gchar * midgard_reflector_property_get_link_name (MidgardReflectorProperty *self
,const gchar *propname
);
|
MidgardReflectorProperty instance |
|
property name |
Returns : |
The name of the class, the given property is a link to.
Or NULL if property is not a link or given property is not registered for given class. [transfer none]
|
Since 10.05
const gchar * midgard_reflector_property_get_link_target (MidgardReflectorProperty *self
,const gchar *propname
);
|
MidgardReflectorProperty instance |
|
property name |
Returns : |
The name of the property, the given one is a link to.
Or NULL if property is not a link or it's not registered for given class. [transfer none]
|
Since 10.05
const gchar * midgard_reflector_property_description (MidgardReflectorProperty *self
,const gchar *propname
);
|
MidgardReflectorProperty instance |
|
property name |
Returns : |
description of the given property or NULL . [transfer none]
|
Since 10.05
const gchar * midgard_reflector_property_get_user_value (MidgardReflectorProperty *self
,const gchar *property
,const gchar *name
);
|
MidgardReflectorProperty instance |
|
property to look value for |
|
name of user defined field |
Returns : |
value for user defined field, or NULL if none found |
Since 10.05
gboolean midgard_reflector_property_is_private (MidgardReflectorProperty *self
,const gchar *property
);
|
MidgardReflectorProperty instance |
|
property name to check |
Returns : |
TRUE , if propery is defined private, FALSE otherwise |
Since 10.05
gboolean midgard_reflector_property_is_unique (MidgardReflectorProperty *self
,const gchar *property
);
|
MidgardReflectorProperty instance |
|
property name to check |
Returns : |
TRUE , if property is defined as unique, FALSE otherwise |
Since 10.05
gboolean midgard_reflector_property_is_primary (MidgardReflectorProperty *self
,const gchar *property
);
|
MidgardReflectorProperty instance |
|
property name to check |
Returns : |
TRUE , if property is primary, FALSE otherwise |
Since 10.05
gboolean midgard_reflector_property_has_default_value (MidgardReflectorProperty *self
,const gchar *property
);
|
MidgardReflectorProperty instance |
|
property name to check |
Returns : |
TRUE , if property has default value, FALSE otherwise |
Since 10.05
GValue * midgard_reflector_property_get_default_value (MidgardReflectorProperty *self
,const gchar *property
);
|
MidgardReflectorProperty instance |
|
property name to check |
Returns : |
GValue value or NULL if property is not registered for the class or there's no default value for the given property |
Since 10.05
"dbclass"
property"dbclass" gchar* : Write / Construct Only
Holds the name of the class which, MidgardReflectorProperty has been initialized for.
Default value: ""