Interface FragmentScope

  • All Known Subinterfaces:
    UploadFragmentScope

    public interface FragmentScope
    Represents a single FormFragment in the FormScope.
    • Method Detail

      • setValue

        void setValue​(Object value)
        Sets the value of the fragment.
        Parameters:
        value - the value of the fragment
      • getValue

        Object getValue()
        Sets the value of the fragment. If there are multiple values, this method returns null.
        Returns:
        the value of the fragment or null if there were no or multiple values
      • addValue

        void addValue​(Object value)
        Adds a value to the list of values for this fragment.
        Parameters:
        value - the new value
      • clearValues

        void clearValues()
        Removes all values for this fragment.
      • getValues

        List<Object> getValues()
        Returns the values of this fragment.
        Returns:
        value of the fragment
      • setValueIsSubmitted

        void setValueIsSubmitted​(Boolean valueIsSubmitted)
        Sets a flag indicating that the value was set based on a value submitted from a frontend form.
        Parameters:
        valueIsSubmitted - true if the value was submitted, otherwise false
      • getValueIsSubmitted

        Boolean getValueIsSubmitted()
        Gets a flag indicating that the value was set based on a value submitted from a frontend form.
        Returns:
        true if the value was submitted, otherwise false
      • setPrefilling

        void setPrefilling​(String prefilling)
        Sets the prefilling of this fragment. This holds the value most recently prefilled.
        Parameters:
        prefilling - the most recent prefilling value of this fragment
      • getPrefilling

        String getPrefilling()
        Returns the most recent prefilling value for this fragment.
        Returns:
        the most recent prefilling value for this fragment.
      • setCondition

        void setCondition​(Boolean condition)
        Sets the value of the condition.
        Parameters:
        condition - true or false or null if no condition was specified
      • getCondition

        Boolean getCondition()
        The value of the condition.
        Returns:
        true or false or null if no condition was specified
      • addMessage

        void addMessage​(String code,
                        String message)
        Adds a message for this specific fragment.
        Parameters:
        code - the code of the message
        message - the actual human-readable message
      • addError

        void addError​(String code,
                      String message)
        Adds an error message for this specific fragment.
        Parameters:
        code - the code of the error message
        message - the actual human-readable error message
      • clearMessages

        void clearMessages()
        Clears the list of messages for the FormFragment to which this FragmentScope is related.
      • clearErrors

        void clearErrors()
        Clears the list of error messages for the FormFragment to which this FragmentScope is related.
      • getErrors

        Map<String,​Object> getErrors()
        Returns all errors for this FormFragment. This is a Map from error code to error message.
        Returns:
        all errors for this FormFragment
      • getMessages

        Map<String,​Object> getMessages()
        Returns all messages for this FormFragment. This is a Map from error code to message.
        Returns:
        all messages for this FormFragment
      • hasErrors

        boolean hasErrors()
        Indicates whether this FormFragment has errors.
        Returns:
        true when the FormFragment has errors, false otherwise
      • setValues

        void setValues​(List<Object> values)
        Sets the values for a multi-value FormFragment.
        Parameters:
        values - the values for the FormFragment