Class FormPersist

  • All Implemented Interfaces:
    Serializable

    public final class FormPersist
    extends Object
    implements 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:
    Serialized Form
    • Constructor Detail

      • FormPersist

        public FormPersist()
    • Method Detail

      • getFormJson

        public com.alibaba.fastjson.JSONObject getFormJson()
        Returns:
        The raw JSON data of the form persist other than the items.
      • getXItemsJson

        public Map<String,​com.alibaba.fastjson.JSONObject> getXItemsJson()
        Returns:
        Raw JSON data of all available items. Key is the AXItemPropertiesData.getId() of the item.
      • getXItemsOrder

        public List<String> getXItemsOrder()
        Returns:
        The order of the getXItems(). Each item in this list is a key (form element ID) into the getXItems() map.
      • isEmpty

        public boolean isEmpty()
        Returns:
        true when this persist is empty, i.e. has got not form data and no items.
      • orderedItemsJson

        public Iterable<com.alibaba.fastjson.JSONObject> orderedItemsJson()
        Convenience method for retrieving the items in order, as raw JSON.
        Returns:
        An iterable over the getXItemsJson() in the order specified by getXItemsOrder().
      • 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

        public void setXItems​(Map<String,​XItem> xItems)
        Parameters:
        xItems - A map between the ID of each item and the parsed item data.
      • setXItemsJson

        public void setXItemsJson​(Map<String,​com.alibaba.fastjson.JSONObject> xItemsJson)
        Parameters:
        xItemsJson - Raw JSON data of all available items. Key is the AXItemPropertiesData.getId() of the item.
      • setXItemsOrder

        public void setXItemsOrder​(List<String> xItemsOrder)
        Parameters:
        xItemsOrder - The order of the getXItems(). Each item in this list is a key (form element ID) into the getXItems() map.
      • empty

        public static FormPersist empty()
        Returns:
        A new empty form persist model with the defaults.