HxmField Class¶
- class Hexaly.Modeler.HxmField¶
An HxmField represents a field belonging to a modeler class. It can be used to get or set the value of a field on objects of the associated class.
Unlike properties, fields are always readable and writable. Furthermore, modifying or reading a field has no side-effects other than changing a value.
HxmFields are not modeler objects: they are merely descriptions that tell the modeler how to modify the fields of a class. They cannot be transformed into modeler values. However, the lifetime of fields follows the same logic as the other concepts and objects described in this API: you must release HxmFields by calling
HxmField.Dispose
or usingHxmReferenceScope
.- Since:
13.0
Summary¶
Returns the value of this field associated with the object given as parameter. |
|
Returns the value of this field associated with the object given as parameter as an integer. |
|
Returns the value of this field associated with the object given as parameter as a double. |
|
Returns the value of this field associated with the object given as parameter as a boolean. |
|
Returns the value of this field associated with the object given as parameter as an expression. |
|
Returns the value of this field associated with the object given as parameter as a string. |
|
Returns the value of this field associated with the object given as parameter as a module. |
|
Returns the value of this field associated with the object given as parameter as a map. |
|
Returns the value of this field associated with the object given as parameter as a function. |
|
Returns the value of this field associated with the object given as parameter as a class. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Releases the reference. |
Instance methods¶
- HxmValue GetValue(HxmValue obj)¶
Returns the value of this field associated with the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- long GetInt(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the field value.- Returns:
Value of the field on the given object.
- Return type:
int
- double GetDouble(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the field value.- Returns:
Value of the field on the given object.
- Return type:
double
- bool GetBool(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the field value.- Returns:
Value of the field on the given object.
- Return type:
bool
- HxExpression GetExpression(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the field value.- Returns:
Value of the field on the given object.
- Return type:
- string GetString(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the field value.- Returns:
Value of the field on the given object.
- Return type:
string
- HxmModule GetModule(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- HxmMap GetMap(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- HxmFunction GetFunction(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- Arguments:
obj (
HxmValue
) – The object on which to retrieve the field value.- Returns:
Value of the field on the given object.
- Return type:
- HxmClass GetClass(HxmValue obj)¶
Returns the value of this field associated with 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 field belongs.
- void SetValue(HxmValue obj, HxmValue value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- void SetInt(HxmValue obj, long value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Arguments:
obj (
HxmValue
) – Object on which to change the field value.value (
long
) – New value of the field.
- void SetDouble(HxmValue obj, double value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Arguments:
obj (
HxmValue
) – Object on which to change the field value.value (
double
) – New value of the field.
- void SetBool(HxmValue obj, bool value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Arguments:
obj (
HxmValue
) – Object on which to change the field value.value (
bool
) – New value of the field.
- void SetExpression(HxmValue obj, HxExpression expression)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Arguments:
obj (
HxmValue
) – Object on which to change the field value.expression (
HxExpression
) – New value of the field.
- void SetString(HxmValue obj, string value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Arguments:
obj (
HxmValue
) – Object on which to change the field value.value (
string
) – New value of the field.
- void SetModule(HxmValue obj, HxmModule module)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- void SetMap(HxmValue obj, HxmMap map)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- void SetFunction(HxmValue obj, HxmFunction function)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Arguments:
obj (
HxmValue
) – Object on which to change the field value.function (
HxmFunction
) – New value of the field.
- void SetClass(HxmValue obj, HxmClass clazz)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- 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.