Class RestFormData


  • public class RestFormData
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      RestFormData​(RestEndpointData endpoint)
      Constructor which will auto-populate the form using the data in the endpoint, this will enable the ajax submit if it is possible to do so.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      List<RestParamData> getItems()
      Returns the list of form parameters.
      boolean isAjaxSubmit()
      Returns whether the form submission should be an ajax submission or a normal submission.
      boolean isBasic()
      Returns whether this form is for a basic endpoint which has no parameters.
      boolean isEmpty()
      Returns true if this form has no parameter in it, false if there is parameter in it.
      boolean isFileUpload()
      Returns whether the form contains a body parameter (i.e. a file upload option).
      void setAjaxSubmit​(boolean ajaxSubmit)
      Controls whether the form will be submitted via ajax and the content rendered on the page, NOTE that uploading any files or downloading any content that is binary will require not using ajax submit, also note that there may be other cases where ajax submission will fail to work OR where normal submission will fail to work (using PUT/DELETE)
      void setFileUpload​(boolean fileUpload)
      Set this to true if the file contains a file upload control, this will be determined automatically for auto-generated forms.
      String toString()
      Returns a string representation of this form.
    • Constructor Detail

      • RestFormData

        public RestFormData​(RestEndpointData endpoint)
                     throws IllegalArgumentException
        Constructor which will auto-populate the form using the data in the endpoint, this will enable the ajax submit if it is possible to do so.
        Parameters:
        endpoint - a RestEndpointData object populated with all parameters it needs
        Throws:
        IllegalArgumentException - when endpoint is null
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Returns true if this form has no parameter in it, false if there is parameter in it.
        Returns:
        a boolean indicating whether this form contains any parameter
      • setAjaxSubmit

        public void setAjaxSubmit​(boolean ajaxSubmit)
        Controls whether the form will be submitted via ajax and the content rendered on the page, NOTE that uploading any files or downloading any content that is binary will require not using ajax submit, also note that there may be other cases where ajax submission will fail to work OR where normal submission will fail to work (using PUT/DELETE)
        Parameters:
        ajaxSubmit - a boolean indicating whether ajax submit is used
      • setFileUpload

        public void setFileUpload​(boolean fileUpload)
        Set this to true if the file contains a file upload control, this will be determined automatically for auto-generated forms.
        Parameters:
        fileUpload - a boolean indicating whether there is file upload in this test
      • toString

        public String toString()
        Returns a string representation of this form.
        Overrides:
        toString in class Object
        Returns:
        a string representation of this form
      • isAjaxSubmit

        public boolean isAjaxSubmit()
        Returns whether the form submission should be an ajax submission or a normal submission.
        Returns:
        a boolean indicating whether the form submission should be an ajax submission or a normal submission
      • isFileUpload

        public boolean isFileUpload()
        Returns whether the form contains a body parameter (i.e. a file upload option).
        Returns:
        a boolean indicating whether the form contains a body parameter (i.e. a file upload option)
      • isBasic

        public boolean isBasic()
        Returns whether this form is for a basic endpoint which has no parameters.
        Returns:
        a boolean indicating whether this form is for a basic endpoint which has no parameters
      • getItems

        public List<RestParamData> getItems()
        Returns the list of form parameters.
        Returns:
        a list of form parameters