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