Package de.xima.fc.mdl.form
Class FormPersist
java.lang.Object
de.xima.fc.mdl.form.FormPersist
- All Implemented Interfaces:
Serializable
POJO model for storing the current form persist JSON, with a few utility methods.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FormPersist
empty()
com.alibaba.fastjson.JSONObject
boolean
isEmpty()
Convenience method for retrieving the items in order.Iterable<com.alibaba.fastjson.JSONObject>
Convenience method for retrieving the items in order, as raw JSON.com.alibaba.fastjson.JSONObject
void
setFormJson
(com.alibaba.fastjson.JSONObject formJson) void
void
setXItemsJson
(Map<String, com.alibaba.fastjson.JSONObject> xItemsJson) void
setXItemsOrder
(List<String> xItemsOrder)
-
Constructor Details
-
FormPersist
public FormPersist()
-
-
Method Details
-
getFormJson
public com.alibaba.fastjson.JSONObject getFormJson()- Returns:
- The raw JSON data of the form persist other than the items.
-
getXItems
- Returns:
- All available parsed items. Key is the
AXItemPropertiesData.getId()
of the item.
-
getXItemsJson
- Returns:
- Raw JSON data of all available items. Key is the
AXItemPropertiesData.getId()
of the item.
-
getXItemsOrder
- Returns:
- The order of the
getXItems()
. Each item in this list is a key (form element ID) into thegetXItems()
map.
-
isEmpty
public boolean isEmpty()- Returns:
true
when this persist is empty, i.e. has got not form data and no items.
-
orderedItems
Convenience method for retrieving the items in order.- Returns:
- An iterable over the
getXItems()
in the order specified bygetXItemsOrder()
.
-
orderedItemsJson
Convenience method for retrieving the items in order, as raw JSON.- Returns:
- An iterable over the
getXItemsJson()
in the order specified bygetXItemsOrder()
.
-
reconstructPersistJson
public com.alibaba.fastjson.JSONObject reconstructPersistJson()- Returns:
- The original persist JSON with the form persist and the items together.
-
setFormJson
public void setFormJson(com.alibaba.fastjson.JSONObject formJson) - Parameters:
formJson
- The raw JSON data of the form persist other than the items.
-
setXItems
- Parameters:
xItems
- A map between the ID of each item and the parsed item data.
-
setXItemsJson
- Parameters:
xItemsJson
- Raw JSON data of all available items. Key is theAXItemPropertiesData.getId()
of the item.
-
setXItemsOrder
- Parameters:
xItemsOrder
- The order of thegetXItems()
. Each item in this list is a key (form element ID) into thegetXItems()
map.
-
empty
- Returns:
- A new empty form persist model with the defaults.
-