org.apache.turbine.util

## Class FormMessages

- java.lang.Object
- - org.apache.turbine.util.FormMessages

-     public class FormMessages
      extends Object

  Used for adding and accessing messages that relate to a specific form and field. Allows to query for messages by form name and field name. Used together with FormMessage class.
  Version:
    $Id: FormMessages.java 1152507 2011-07-30 20:14:38Z tv $
  Author:
    Neeme Praks

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FormMessages()` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FormMessage[]` | `getFormMessages(String formName)` Gets all form messages for a given form.
    `FormMessage[]` | `getFormMessages(String formName, String fieldName)` Get form messages for a given form and field.
    `void` | `setMessage(String formName, String fieldName, long returnCode)` Sets a message for a field of a form.
    `void` | `setMessage(String formName, String fieldName, String messageName)` Sets a message for a field of a form.

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

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

- - ### Constructor Detail

    - #### FormMessages

          public FormMessages()

      Constructor.

  - ### Method Detail

    - #### setMessage

          public void setMessage(String formName,
                        String fieldName,
                        long returnCode)

      Sets a message for a field of a form. The message is given as a long representing a return code.
      Parameters:
        `formName` - A String with the form name.
        `fieldName` - A String with the field name.
        `returnCode` - A long with the return code.

    - #### setMessage

          public void setMessage(String formName,
                        String fieldName,
                        String messageName)

      Sets a message for a field of a form. The message is given as a String.
      Parameters:
        `formName` - A String with the form name.
        `fieldName` - A String with the field name.
        `messageName` - A String with the message.

    - #### getFormMessages

          public FormMessage[] getFormMessages(String formName)

      Gets all form messages for a given form.
      Parameters:
        `formName` - A String with the form name.
      Returns:
        A FormMessage[].

    - #### getFormMessages

          public FormMessage[] getFormMessages(String formName,
                                      String fieldName)

      Get form messages for a given form and field.
      Parameters:
        `formName` - A String with the form name.
        `fieldName` - A String with the field name.
      Returns:
        A FormMessage[].

Copyright © 2000-2015 The Apache Software Foundation. All Rights Reserved.