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
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedValueReferencingControl(String type, IValueAccessor<?> root, String path) Creates a new value-referencing control. -
Method Summary
Modifier and TypeMethodDescriptionprotected final ObjectReads the value referenced by the control's path expression from the root object.protected final voidwriteValue(Object value) Writes a value to the location referenced by the control's path expression in the root object.
-
Constructor Details
-
ValueReferencingControl
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 Details
-
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
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.
-