HxmProperty Class¶
- class hexaly.modeler.HxmProperty¶
An HxmProperty represents a property belonging to a modeler class. It can be used to get or set the value of a property on objects of the associated class.
Unlike propertys, properties do not have an actual value and can be readonly. The value is represented by two functions: a getter function and a setter function which can be absent.
- Since:
13.0
Summary¶
Returns true if the property is readonly. |
Returns the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Returns true if this property is read-only. |
Instance methods¶
- HxmProperty.get(obj)¶
Returns the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to retrieve the property value.
- Returns:
The value of the property on the given object.
- HxmProperty.set(obj, value)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs. An exception will be thrown if this property is read-only.
This method accepts values of the following types:
NoneType
(nil in Hexaly Modeler)bool
int
float
str
- Parameters:
obj (
HxmValue
) – Object on which to set the property value.value – New value of the property.
- HxmProperty.is_readonly()¶
Returns true if this property is read-only.
- Returns:
True if this property is read-only.
Instance attributes¶
- HxmProperty.readonly¶
Returns true if the property is readonly. This is a shortcut for
HxmProperty.is_readonly()
.