Class Message

java.lang.Object
com.echothree.util.common.message.Message
All Implemented Interfaces:
Serializable

public class Message extends Object implements Serializable

An encapsulation of an individual message returned by the validate() method of an ActionForm, consisting of a message key (to be used to look up message text in an appropriate message resources database) plus up to four placeholder objects that can be used for parametric replacement in the message text.

Since:
Struts 1.1
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The message key for this message.
    protected String
    The message for this message, with all value substitutions completed.
    protected Object[]
    The replacement values for this mesasge.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct an action message with no replacement values.
    Message(String key, Object... values)
    Construct an action message with the specified replacement values.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the message key for this message.
    Get the message for this message.
    Get the replacement values for this message.
    void
    setMessage(String message)
    Set the message for this message.
    Converts to a string representing the data contained within this Message.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • key

      protected String key
      The message key for this message.
    • values

      protected Object[] values
      The replacement values for this mesasge.
    • message

      protected String message
      The message for this message, with all value substitutions completed.
  • Constructor Details

    • Message

      public Message(String key)
      Construct an action message with no replacement values.
      Parameters:
      key - Message key for this message
    • Message

      public Message(String key, Object... values)
      Construct an action message with the specified replacement values.
      Parameters:
      key - Message key for this message
      values - One or more replacement values
  • Method Details

    • getKey

      public String getKey()
      Get the message key for this message.
    • getValues

      public Object[] getValues()
      Get the replacement values for this message.
    • getMessage

      public String getMessage()
      Get the message for this message.
    • setMessage

      public void setMessage(String message)
      Set the message for this message.
    • toString

      public String toString()
      Converts to a string representing the data contained within this Message.
      Overrides:
      toString in class Object