Class ValueReferencingControl
- java.lang.Object
-
- de.xima.fc.gui.model.value_descriptor_form.Control
-
- de.xima.fc.gui.model.value_descriptor_form.ValueReferencingControl
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AddListItemControl,AddMapEntryControl,AddRecordEntryControl,EditableControl,ListItemControl,MapEntryControl,RecordEntryControl
public abstract class ValueReferencingControl extends Control
AControlthat references a value via a JSON path expression.- Since:
- 8.5.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedValueReferencingControl(String type, IValueAccessor<?> root, String path)Creates a new value-referencing control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectreadValue()Reads the value referenced by the control's path expression from the root object.protected voidwriteValue(Object value)Writes a value to the location referenced by the control's path expression in the root object.
-
-
-
Constructor Detail
-
ValueReferencingControl
protected ValueReferencingControl(String type, IValueAccessor<?> root, String path)
Creates a new value-referencing control.- Parameters:
type- The type of the control that determines how it is rendered.root- The root object against which the path is evaluated.path- The JSON path expression that references the value.
-
-
Method Detail
-
readValue
protected final Object readValue()
Reads the value referenced by the control's path expression from the root object.- Returns:
- The referenced value, or
nullif the path does not resolve to a value.
-
writeValue
protected final void writeValue(Object value)
Writes a value to the location referenced by the control's path expression in the root object. If the path is"$", the root object itself is replaced with the new value.- Parameters:
value- The value to write.
-
-