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 using HxmReferenceScope.

Since:13.0

Summary

Methods
GetValue Returns the value of this property for the object given as parameter.
GetInt Returns the value of this property for the object given as parameter as an integer.
GetDouble Returns the value of this property for the object given as parameter as a double.
GetBool Returns the value of this property for the object given as parameter as a boolean.
GetExpression Returns the value of this property for the object given as parameter as an expression.
GetString Returns the value of this property for the object given as parameter as a string.
GetModule Returns the value of this property for the object given as parameter as a module.
GetMap Returns the value of this property for the object given as parameter as a map.
GetFunction Returns the value of this property for the object given as parameter as a function.
GetClass Returns the value of this property for the object given as parameter as a class.
SetValue Sets the value of this property for the object given as parameter.
SetInt Sets the value of this property for the object given as parameter.
SetDouble Sets the value of this property for the object given as parameter.
SetBool Sets the value of this property for the object given as parameter.
SetExpression Sets the value of this property for the object given as parameter.
SetString Sets the value of this property for the object given as parameter.
SetModule Sets the value of this property for the object given as parameter.
SetMap Sets the value of this property for the object given as parameter.
SetFunction Sets the value of this property for the object given as parameter.
SetClass Sets the value of this property for the object given as parameter.
IsReadOnly Returns true if this property is read-only.
Dispose 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.

Arguments:obj (HxmValue) – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
Return type:HxmValue
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:HxExpression
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.

Arguments:obj (HxmValue) – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
Return type:HxmModule
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.

Arguments:obj (HxmValue) – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
Return type:HxmMap
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:HxmFunction
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.

Arguments:obj (HxmValue) – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
Return type:HxmClass
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.

Arguments:
  • obj (HxmValue) – Object on which to change the property value.
  • value (HxmValue) – New value of the property.
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.

Arguments:
  • obj (HxmValue) – Object on which to change the property value.
  • module (HxmModule) – New value of the property.
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.

Arguments:
  • obj (HxmValue) – Object on which to change the property value.
  • map (HxmMap) – New value of the property.
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.

Arguments:
  • obj (HxmValue) – Object on which to change the property value.
  • clazz (HxmClass) – New value of the property.
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.