Package com.hexaly.modeler
Class HxmField
java.lang.Object
com.hexaly.modeler.HxmField
- All Implemented Interfaces:
AutoCloseable
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 close() or using HxmReferenceScope.
- Since:
- 13.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases the reference.booleanbooleanReturns the value of this field associated with the object given in parameter as a boolean.Returns the value of this field associated with the object given in parameter as a class.doubleReturns the value of this field associated with the object given in parameter as a double.getExpression(HxmValue obj) Returns the value of this field associated with the object given in parameter as an expression.getFunction(HxmValue obj) Returns the value of this field associated with the object given in parameter as a function.longReturns the value of this field associated with the object given in parameter as an integer.Returns the value of this field associated with the object given in parameter as a map.Returns the value of this field associated with the object given in parameter as a module.Returns the value of this field associated with the object given in parameter as a string.Returns the value of this field associated with the object given in parameter.inthashCode()voidSets the value of this field for the object given in parameter.voidSets the value of this field for the object given in parameter.voidSets the value of this field for the object given in parameter.voidsetExpression(HxmValue obj, HxExpression expr) Sets the value of this field for the object given in parameter.voidsetFunction(HxmValue obj, HxmFunction function) Sets the value of this field for the object given in parameter.voidSets the value of this field for the object given in parameter.voidSets the value of this field for the object given in parameter.voidSets the value of this field for the object given in parameter.voidSets the value of this field for the object given in parameter.voidSets the value of this field for the object given in parameter.
-
Method Details
-
close
public void close()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.- Specified by:
closein interfaceAutoCloseable
-
getValue
Returns the value of this field associated with the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to retrieve the field.- Returns:
- Value of the field on the given object.
- See Also:
-
getInt
Returns the value of this field associated with the object given in parameter as an integer. An exception will be thrown if the returned value is not an integer. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to retrieve the field.- Returns:
- Value of the field on the given object.
- See Also:
-
getDouble
Returns the value of this field associated with the object given in parameter as a double. An exception will be thrown if the returned value is not a double. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to retrieve the field.- Returns:
- Value of the field on the given object.
- See Also:
-
getBool
Returns the value of this field associated with the object given in parameter as a boolean. An exception will be thrown if the returned value is not a boolean. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to retrieve the field.- Returns:
- Value of the field on the given object.
- See Also:
-
getExpression
Returns the value of this field associated with the object given in parameter as an expression. An exception will be thrown if the returned value is not an expression. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to retrieve the field.- Returns:
- Value of the field on the given object.
- See Also:
-
getString
Returns the value of this field associated with the object given in parameter as a string. An exception will be thrown if the returned value is not a string. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to retrieve the field.- Returns:
- Value of the field on the given object.
- See Also:
-
getModule
Returns the value of this field associated with the object given in parameter as a module. An exception will be thrown if the returned value is not a module. The object passed in parameter must be an instance of the class to which this field belongs. -
getMap
Returns the value of this field associated with the object given in parameter as a map. An exception will be thrown if the returned value is not a map. The object passed in parameter must be an instance of the class to which this field belongs. -
getFunction
Returns the value of this field associated with the object given in parameter as a function. An exception will be thrown if the returned value is not a function. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to retrieve the field.- Returns:
- Value of the field on the given object.
- See Also:
-
getClass
Returns the value of this field associated with the object given in parameter as a class. An exception will be thrown if the returned value is not a class. The object passed in parameter must be an instance of the class to which this field belongs. -
setValue
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to change the field value.value- New value of the field.- See Also:
-
setInt
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to change the field value.value- New value of the field.- See Also:
-
setDouble
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to change the field value.value- New value of the field.- See Also:
-
setBool
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to change the field value.value- New value of the field.- See Also:
-
setExpression
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to change the field value.expr- New value of the field.- See Also:
-
setString
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to change the field value.value- New value of the field.- See Also:
-
setModule
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs. -
setMap
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs. -
setFunction
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs.- Parameters:
obj- Object on which to change the field value.function- New value of the field.- See Also:
-
setClass
Sets the value of this field for the object given in parameter. The object passed in parameter must be an instance of the class to which this field belongs. -
hashCode
public int hashCode() -
equals
-