Depending on the type of the property, there are up to 3 methods for a single property. Let <property> denote the name of a property and <Property> the name of the property with an uppercase first letter. And let T be the type of the property; for primitive wrappers we use the primitive type here, e.g. String for StringProperty and double for ReadOnlyDoubleProperty.
| Method name | Parameters | Return type | Purpose |
|---|---|---|---|
<property>Property | () | The property itself, e.g.DoubleProperty, ReadOnlyStringProperty, ObjectProperty<VPos> | return the property itself for adding listeners / binding |
get<Property> | () | T | return the value wrapped in the property |
set<Property> | (T) | void | set the value of the property |
Note that the setter does not exist for readonly properties.
Readonly list properties are properties that provide only a getter method. The type of such a property is ObservableList, preferably with a type agrument specified. The value of this property never changes; the content of the ObservableList may be changed instead.
Similar to readonly list properties readonly map properties only provide a getter and the content may be modified instead of the property value. The getter returns a ObservableMap.