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 fields, 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.
HxmProperty are not modeler objects: they are merely descriptions that tell the modeler how to modify the properties of a class. They cannot be transformed into modeler values. However, the lifetime of properties follows the same logic as the other concepts and objects described in this API: you must release HxmPropertys by calling
HxmProperty.Dispose
or usingHxmReferenceScope
.- Since:
13.0
Summary¶
Returns the value of this property for the object given as parameter. |
|
Returns the value of this property for the object given as parameter as an integer. |
|
Returns the value of this property for the object given as parameter as a double. |
|
Returns the value of this property for the object given as parameter as a boolean. |
|
Returns the value of this property for the object given as parameter as an expression. |
|
Returns the value of this property for the object given as parameter as a string. |
|
Returns the value of this property for the object given as parameter as a module. |
|
Returns the value of this property for the object given as parameter as a map. |
|
Returns the value of this property for the object given as parameter as a function. |
|
Returns the value of this property for the object given as parameter as a class. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets 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. |
|
Releases the reference. |
Instance methods¶
- HxmValue GetValue(HxmValue 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.
- long GetInt(HxmValue obj)¶
Returns the value of this property for the object given as parameter as an integer. An exception will be thrown if the returned value is not an integer. The object passed as parameter must be an instance of the class to which this property belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the property value.- Returns:
Value of the property on the given object.
- Return type:
int
- double GetDouble(HxmValue obj)¶
Returns the value of this property for the object given as parameter as a double. An exception will be thrown if the returned value is not a double. The object passed as parameter must be an instance of the class to which this property belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the property value.- Returns:
Value of the property on the given object.
- Return type:
double
- bool GetBool(HxmValue obj)¶
Returns the value of this property for the object given as parameter as a boolean. An exception will be thrown if the returned value is not a boolean. The object passed as parameter must be an instance of the class to which this property belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the property value.- Returns:
Value of the property on the given object.
- Return type:
bool
- HxExpression GetExpression(HxmValue obj)¶
Returns the value of this property for the object given as parameter as an expression. An exception will be thrown if the returned value is not an expression. The object passed as parameter must be an instance of the class to which this property belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the property value.- Returns:
Value of the property on the given object.
- Return type:
- string GetString(HxmValue obj)¶
Returns the value of this property for the object given as parameter as a string. An exception will be thrown if the returned value is not a string. The object passed as parameter must be an instance of the class to which this property belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the property value.- Returns:
Value of the property on the given object.
- Return type:
string
- HxmModule GetModule(HxmValue obj)¶
Returns the value of this property for the object given as parameter as a module. An exception will be thrown if the returned value is not a module. The object passed as parameter must be an instance of the class to which this property belongs.
- HxmMap GetMap(HxmValue obj)¶
Returns the value of this property for the object given as parameter as a map. An exception will be thrown if the returned value is not a map. The object passed as parameter must be an instance of the class to which this property belongs.
- HxmFunction GetFunction(HxmValue obj)¶
Returns the value of this property for the object given as parameter as a function. An exception will be thrown if the returned value is not a function. The object passed as parameter must be an instance of the class to which this property belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the property value.- Returns:
Value of the property on the given object.
- Return type:
- HxmClass GetClass(HxmValue obj)¶
Returns the value of this property for the object given as parameter as a class. An exception will be thrown if the returned value is not a class. The object passed as parameter must be an instance of the class to which this property belongs.
- void SetValue(HxmValue obj, HxmValue 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.
- void SetInt(HxmValue obj, long 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.
- Arguments:
obj (
HxmValue
) – Object on which to change the property value.value (
long
) – New value of the property.
- void SetDouble(HxmValue obj, double 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.
- Arguments:
obj (
HxmValue
) – Object on which to change the property value.value (
double
) – New value of the property.
- void SetBool(HxmValue obj, bool 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.
- Arguments:
obj (
HxmValue
) – Object on which to change the property value.value (
bool
) – New value of the property.
- void SetExpression(HxmValue obj, HxExpression expression)¶
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.
- Arguments:
obj (
HxmValue
) – Object on which to change the property value.expression (
HxExpression
) – New value of the property.
- void SetString(HxmValue obj, string 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.
- Arguments:
obj (
HxmValue
) – Object on which to change the property value.value (
string
) – New value of the property.
- void SetModule(HxmValue obj, HxmModule module)¶
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.
- void SetMap(HxmValue obj, HxmMap map)¶
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.
- void SetFunction(HxmValue obj, HxmFunction function)¶
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.
- Arguments:
obj (
HxmValue
) – Object on which to change the property value.function (
HxmFunction
) – New value of the property.
- void SetClass(HxmValue obj, HxmClass clazz)¶
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.
- bool IsReadOnly()¶
Returns true if this property is read-only.
- void Dispose()¶
Releases the reference. If this value was already released, returns immediately and does nothing. Invoking any method on this object after this operation will throw an exception.