HxmProperty Class

class 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.

Since:13.0

Summary

Functions
getValue Returns the value of this property associated with the object given as parameter.
getInt Returns the value of this property associated with the object given as parameter as an integer.
getDouble Returns the value of this property associated with the object given as parameter as a double.
getBool Returns the value of this property associated with the object given as parameter as a boolean.
getExpression Returns the value of this property associated with the object given as parameter as an expression.
getString Returns the value of this property associated with the object given as parameter as a string.
getModule Returns the value of this property associated with the object given as parameter as a module.
getMap Returns the value of this property associated with the object given as parameter as a map.
getFunction Returns the value of this property associated with the object given as parameter as a function.
getClass Returns the value of this property associated with 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 the property is read-only.

Functions

HxmValue HxmProperty::getValue(const HxmValue &obj) const

Returns the value of this property associated with the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
See:HxmValue
long HxmProperty::getInt(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
double HxmProperty::getDouble(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
bool HxmProperty::getBool(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
HxExpression HxmProperty::getExpression(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
See:HxExpression
string HxmProperty::getString(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
HxmModule HxmProperty::getModule(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
See:HxmModule
HxmMap HxmProperty::getMap(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
See:HxmMap
HxmFunction HxmProperty::getFunction(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
See:HxmFunction
HxmClass HxmProperty::getClass(const HxmValue &obj) const

Returns the value of this property 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 property belongs.

Parameters:obj – The object on which to retrieve the property value.
Returns:Value of the property on the given object.
See:HxmClass
void HxmProperty::setValue(HxmValue &obj, const 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.

Parameters:
  • obj – Object on which to change the property value.
  • value – New value of the property.
void HxmProperty::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.

Parameters:
  • obj – Object on which to change the property value.
  • value – New value of the property.
void HxmProperty::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.

Parameters:
  • obj – Object on which to change the property value.
  • value – New value of the property.
void HxmProperty::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.

Parameters:
  • obj – Object on which to change the property value.
  • value – New value of the property.
void HxmProperty::setExpression(HxmValue &obj, const 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.

Parameters:
  • obj – Object on which to change the property value.
  • expression – New value of the property.
See:

HxExpression

void HxmProperty::setString(HxmValue &obj, const std::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.

Parameters:
  • obj – Object on which to change the property value.
  • value – New value of the property.
void HxmProperty::setModule(HxmValue &obj, const 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.

Parameters:
  • obj – Object on which to change the property value.
  • module – New value of the property.
See:

HxmModule

void HxmProperty::setMap(HxmValue &obj, const 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.

Parameters:
  • obj – Object on which to change the property value.
  • map – New value of the property.
See:

HxmMap

void HxmProperty::setFunction(HxmValue &obj, const 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.

Parameters:
  • obj – Object on which to change the property value.
  • function – New value of the property.
See:

HxmFunction

void HxmProperty::setClass(HxmValue &obj, const 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.

Parameters:
  • obj – Object on which to change the property value.
  • clazz – New value of the property.
See:

HxmClass

bool HxmProperty::isReadOnly() const

Returns true if the property is read-only.