com.acsinet_solutions.cetia4.controller.support
Class CompoundMessage

java.lang.Object
  extended by com.acsinet_solutions.cetia4.controller.support.CompoundMessage

public final class CompoundMessage
extends java.lang.Object

This class implements a compound message that allows various messages to be stored and displayed in a JSP page. This is meant to be stored within the com.acsinet_solutions.cetia4.controller.AttributeKeys._MESSAGE_KEY session/request attribute.

The individual messages of a CompoundMessage may be obtained individually, or combined in an HTML list using the toString() method.

The setMessage() method of com.acsinet_solutions.cetia4.controller.RequestContext will transparently append messages to a CompoundMessage with every call of it, so newly added messages won't override previous ones.

Author:
Santiago Arriaga

Constructor Summary
CompoundMessage(java.lang.String message)
          Create a CompoundMessage with the provided starting message
 
Method Summary
 void add(java.lang.String message)
          Add a message to the internal list.
 java.util.List<java.lang.String> getList()
          Obtain the list of messages.
 java.lang.String toString()
          Convenience display method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompoundMessage

public CompoundMessage(java.lang.String message)
Create a CompoundMessage with the provided starting message

Method Detail

add

public final void add(java.lang.String message)
Add a message to the internal list.


getList

public final java.util.List<java.lang.String> getList()
Obtain the list of messages. At least one message will be stored in the returned list. This method may be useful for custom display of the messages.


toString

public final java.lang.String toString()
Convenience display method. returns the message if it's only one, or an HTML list of messages if there is more than one.

Overrides:
toString in class java.lang.Object