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.Disposeor usingHxmReferenceScope.Since: 13.0
Summary¶
GetValue |
Returns the value of this field associated with the object given as parameter. |
GetInt |
Returns the value of this field associated with the object given as parameter as an integer. |
GetDouble |
Returns the value of this field associated with the object given as parameter as a double. |
GetBool |
Returns the value of this field associated with the object given as parameter as a boolean. |
GetExpression |
Returns the value of this field associated with the object given as parameter as an expression. |
GetString |
Returns the value of this field associated with the object given as parameter as a string. |
GetModule |
Returns the value of this field associated with the object given as parameter as a module. |
GetMap |
Returns the value of this field associated with the object given as parameter as a map. |
GetFunction |
Returns the value of this field associated with the object given as parameter as a function. |
GetClass |
Returns the value of this field associated with the object given as parameter as a class. |
SetValue |
Sets the value of this field for the object given as parameter. |
SetInt |
Sets the value of this field for the object given as parameter. |
SetDouble |
Sets the value of this field for the object given as parameter. |
SetBool |
Sets the value of this field for the object given as parameter. |
SetExpression |
Sets the value of this field for the object given as parameter. |
SetString |
Sets the value of this field for the object given as parameter. |
SetModule |
Sets the value of this field for the object given as parameter. |
SetMap |
Sets the value of this field for the object given as parameter. |
SetFunction |
Sets the value of this field for the object given as parameter. |
SetClass |
Sets the value of this field for the object given as parameter. |
Dispose |
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.
Arguments: obj ( HxmValue) – The object on which to retrieve the field value.Returns: Value of the field on the given object. Return type: HxmValue
-
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: HxExpression
-
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.
Arguments: obj ( HxmValue) – The object on which to retrieve the field value.Returns: Value of the field on the given object. Return type: HxmModule
-
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.
Arguments: obj ( HxmValue) – The object on which to retrieve the field value.Returns: Value of the field on the given object. Return type: HxmMap
-
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: HxmFunction
-
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.
Arguments: obj ( HxmValue) – The object on which to retrieve the field value.Returns: Value of the field on the given object. Return type: HxmClass
-
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.
Arguments:
-
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.
- obj (
-
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.
- obj (
-
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.
- obj (
-
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.
- obj (
-
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.
- obj (
-
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.
Arguments:
-
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.
Arguments:
-
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.
- obj (
-
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.
Arguments:
-
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.