Class FormPersistHelper
java.lang.Object
de.xima.fc.gui.designer.form.utils.FormPersistHelper
Helper for working with the form persist JSON from the client, such as applying increment patches.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionstatic FormPersist
createCopy
(FormPersist formPersist) static FormPersist
createPersistFromJson
(com.alibaba.fastjson.JSONObject json) static FormPersistModifications
patch
(FormPersist persist, Iterable<PersistDiff> diffs) Applies a JSON patch to the persist JSON, see https://tools.ietf.org/html/rfc6902static void
replace
(FormPersist persist, com.alibaba.fastjson.JSONObject newPersistJson) Replaces the persist JSON with the new persist, updating all form items.
-
Method Details
-
createCopy
-
createPersistFromJson
- Parameters:
json
- Form persist JSON.- Returns:
- A new form persist JSON wrapper with additional data, filled with the given form persist JSON data.
-
patch
Applies a JSON patch to the persist JSON, see https://tools.ietf.org/html/rfc6902- Parameters:
persist
- Form persist to modify.diffs
- Persist diffs to apply.- Returns:
- Modifications that were made.
-
replace
Replaces the persist JSON with the new persist, updating all form items.- Parameters:
persist
- Form persist to modify.newPersistJson
- New persist JSON to use.
-