org.appng.formtags

## Class Form

- java.lang.Object
- - org.appng.formtags.Form

-     public class Form
      extends Object

  This class represents a HTML form. A `Form` consists of two parts:
  1. the `FormData`, wrapping the various `FormElement`s
  2. the `FormConfirmation`, responsible for what happens after the form has been submitted.
  A Form can habe multiple `FormProcessProvider`s which are processing the form inputs.
  Author:
    Matthias Müller
  See Also:
    `FormData`, `FormElement`, `FormConfirmation`, `FormProcessProvider`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Form()` Constructs a new `Form`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addFormProcessProvider(FormProcessProvider formProcessProvider)` Adds a `FormProcessProvider` to this `Form`.
    `void` | `enableLogging()` Enables logging for this `Form` by adding a `LogFormData` to the form's `FormProcessProvider`s.
    `FormConfirmation` | `getFormConfirmation()` Returns the `FormConfirmation` for this `Form`.
    `FormData` | `getFormData()` Returns the `FormData` for this `Form`.
    `Request` | `getRequest()` Returns the `Request` for this `Form`.
    `Boolean` | `getRestoreRequestData()`
    `RuleValidation` | `getRuleValidation()` Returns the `RuleValidation` for this `Form`.
    `boolean` | `hasErrors()` Convenient method for checking whethers this `Form` has validation errors, delegating to `FormElementOwner.hasErrors()`.
    `boolean` | `isSubmitted()` Checks whether this `Form` has been submitted.
    `boolean` | `removeFormProcessProvider(FormProcessProvider formProcessProvider)` Removes a `FormProcessProvider` to this `Form`.
    `void` | `runProcessProviders(Writer writer, Map<String,Object> properties)` Executes the `FormProcessProvider` previously added by calling `addFormProcessProvider(FormProcessProvider)`.
    `void` | `setFormConfirmation(FormConfirmation formConfirmation)` Sets the `FormConfirmation` for this `Form`.
    `void` | `setFormData(FormData formData)` Sets the `FormData` for this `Form`.
    `void` | `setRequest(Request request)` Sets the `Request` for this form.
    `void` | `setRestoreRequestData(Boolean restoreRequestData)`
    `void` | `setSubmitted(boolean submitted)` Sets whether or not this `Form` has been submitted.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Form

          public Form()

      Constructs a new `Form`

  - ### Method Detail

    - #### enableLogging

          public void enableLogging()

      Enables logging for this `Form` by adding a `LogFormData` to the form's `FormProcessProvider`s.

    - #### addFormProcessProvider

          public boolean addFormProcessProvider(FormProcessProvider formProcessProvider)

      Adds a `FormProcessProvider` to this `Form`.
      Parameters:
        `formProcessProvider` - the `FormProcessProvider` to add
      Returns:
        `true` if adding was successful, `false` otherwise

    - #### removeFormProcessProvider

          public boolean removeFormProcessProvider(FormProcessProvider formProcessProvider)

      Removes a `FormProcessProvider` to this `Form`.
      Parameters:
        `formProcessProvider` - the `FormProcessProvider` to remove
      Returns:
        `true` if removing was successful, `false` otherwise

    - #### isSubmitted

          public boolean isSubmitted()

      Checks whether this `Form` has been submitted.
      Returns:
        `true` if this `Form` has been submitted, `false` otherwise

    - #### setSubmitted

          public void setSubmitted(boolean submitted)

      Sets whether or not this `Form` has been submitted.
      Parameters:
        `submitted` -

    - #### hasErrors

          public boolean hasErrors()

      Convenient method for checking whethers this `Form` has validation errors, delegating to `FormElementOwner.hasErrors()`.
      Returns:
        `true` if this `Form` has validation errors, `false` otherwise

    - #### getRequest

          public Request getRequest()

      Returns the `Request` for this `Form`.
      Returns:
        the `Request`

    - #### setRequest

          public void setRequest(Request request)

      Sets the `Request` for this form.
      Parameters:
        `request` - the `Request`

    - #### getRuleValidation

          public RuleValidation getRuleValidation()

      Returns the `RuleValidation` for this `Form`.
      Returns:
        the `RuleValidation`

    - #### getRestoreRequestData

          public Boolean getRestoreRequestData()

    - #### setRestoreRequestData

          public void setRestoreRequestData(Boolean restoreRequestData)

    - #### getFormData

          public FormData getFormData()

      Returns the `FormData` for this `Form`.
      Returns:
        the `FormData`

    - #### setFormData

          public void setFormData(FormData formData)

      Sets the `FormData` for this `Form`.
      Parameters:
        `formData` - the `FormData`

    - #### getFormConfirmation

          public FormConfirmation getFormConfirmation()

      Returns the `FormConfirmation` for this `Form`.
      Returns:
        the `FormConfirmation`

    - #### setFormConfirmation

          public void setFormConfirmation(FormConfirmation formConfirmation)

      Sets the `FormConfirmation` for this `Form`.
      Parameters:
        `formConfirmation` - the `FormConfirmation`

    - #### runProcessProviders

          public void runProcessProviders(Writer writer,
                                          Map<String,Object> properties)

      Executes the `FormProcessProvider` previously added by calling `addFormProcessProvider(FormProcessProvider)`. Thus means, `FormProcessProvider.onFormSuccess(Writer, Form, Map)` is being executed with the given `Writer` and the given property `Map`.
      Parameters:
        `writer` - a `Writer`
        `properties` - the property `Map`
      See Also:
        `FormProcessProvider.onFormSuccess(Writer, Form, Map)`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.