Class FormPersistHelper
- java.lang.Object
-
- de.xima.fc.gui.designer.form.utils.FormPersistHelper
-
public final class FormPersistHelper extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
createCopy
public static FormPersist createCopy(FormPersist formPersist)
-
createPersistFromJson
public static FormPersist createPersistFromJson(com.alibaba.fastjson.JSONObject json)
- Parameters:
json
- Form persist JSON.- Returns:
- A new form persist JSON wrapper with additional data, filled with the given form persist JSON data.
-
patch
public static FormPersistModifications patch(FormPersist persist, Iterable<PersistDiff> diffs)
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
public static void replace(FormPersist persist, com.alibaba.fastjson.JSONObject newPersistJson)
Replaces the persist JSON with the new persist, updating all form items.- Parameters:
persist
- Form persist to modify.newPersistJson
- New persist JSON to use.
-
-