ParamSpec


Object Hierarchy:

Object hierarchy for ParamSpec

Description:

public class ParamSpec

ParamSpec is an object structure that encapsulates the metadata required to specify parameters, such as e.

g. Object properties.

Parameter names # {canonical-parameter-names}

Parameter names need to start with a letter (a-z or A-Z). Subsequent characters can be letters, numbers or a '-'. All other characters are replaced by a '-' during construction. The result of this replacement is called the canonical name of the parameter.

Example: Object-introspection:

public class MyObject : Object {
public int myprop1 { get; set; }
public int myprop2 { get; set; }
public int myprop3 { get; set; }
}

public static int main (string[] args) {
// Output:
// ``myprop1``
// ``myprop2``
// ``myprop3``
Type type = typeof (MyObject);
ObjectClass ocl = (ObjectClass) type.class_ref ();
foreach (ParamSpec spec in ocl.list_properties ()) {
print ("%s\n", spec.get_name ());
}

// Output: ``nick: myprop1``
unowned ParamSpec? spec = ocl.find_property ("myprop1");
print ("nick: %s\n", spec.get_nick ());

return 0;
}

valac --pkg gobject-2.0 GLib.ObjectClass.vala


Namespace: GLib
Package: gobject-2.0

Content:

Creation methods:

Methods:

Fields: