de.mguennewig.pobjform
Class Messages

java.lang.Object
  extended by de.mguennewig.pobjform.Messages

public class Messages
extends java.lang.Object

Container for messages in a set of properties.

Author:
Michael Günnewig

Field Summary
static java.lang.String ERROR_KEY
           
static java.lang.String GLOBAL_ERROR
          The property for global error messages.
static java.lang.String GLOBAL_MESSAGE
          The property for global messages.
static java.lang.String MESSAGE_KEY
           
 
Constructor Summary
Messages()
          Creates a new message container.
 
Method Summary
 void add(java.lang.String property, Message msg)
          Add a message to the set of messages for the specified property.
 void addError(java.lang.String messageId, java.lang.Object... params)
          Adds an error message to the set of global messages.
 void addSuccess(java.lang.String messageId, java.lang.Object... params)
          Adds a success message to the set of global messages.
 void clear()
          Clear all messages recorded by this object.
 void clearMessage(java.lang.String property, java.lang.String msgKey)
          Removes a specific message for the given property.
 java.util.Iterator<Message> get()
           
 java.util.Iterator<Message> get(java.lang.String property)
          Return the set of messages related to a specific property.
 java.util.Iterator<java.lang.String> getProperties()
          Return the set of property names for which at least one message has been recorded.
 boolean isEmpty()
          Return true if there are no messages recorded in this object, or false otherwise.
 int size()
          Return the number of messages recorded for all properties (including global messages).
 int size(java.lang.String property)
          Return the number of messages associated with the specified property.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_KEY

public static final java.lang.String ERROR_KEY
See Also:
Constant Field Values

MESSAGE_KEY

public static final java.lang.String MESSAGE_KEY
See Also:
Constant Field Values

GLOBAL_MESSAGE

public static final java.lang.String GLOBAL_MESSAGE
The property for global messages.

See Also:
Constant Field Values

GLOBAL_ERROR

public static final java.lang.String GLOBAL_ERROR
The property for global error messages.

See Also:
Constant Field Values
Constructor Detail

Messages

public Messages()
Creates a new message container.

Method Detail

add

public void add(java.lang.String property,
                Message msg)
Add a message to the set of messages for the specified property.


addError

public void addError(java.lang.String messageId,
                     java.lang.Object... params)
Adds an error message to the set of global messages.


addSuccess

public void addSuccess(java.lang.String messageId,
                       java.lang.Object... params)
Adds a success message to the set of global messages.


clear

public void clear()
Clear all messages recorded by this object.


clearMessage

public void clearMessage(java.lang.String property,
                         java.lang.String msgKey)
Removes a specific message for the given property.


getProperties

public java.util.Iterator<java.lang.String> getProperties()
Return the set of property names for which at least one message has been recorded.


get

public java.util.Iterator<Message> get()

get

public java.util.Iterator<Message> get(java.lang.String property)
Return the set of messages related to a specific property.


isEmpty

public boolean isEmpty()
Return true if there are no messages recorded in this object, or false otherwise.


size

public int size()
Return the number of messages recorded for all properties (including global messages).


size

public int size(java.lang.String property)
Return the number of messages associated with the specified property.


toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object