|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A class that encapsulates messages. Messages can be either global or they are specific to a particular bean property.
Each individual message is described by an Message
object, which contains a message key (to be looked up in an appropriate
message resources database), and up to four placeholder arguments used for
parametric substitution in the resulting message.
IMPLEMENTATION NOTE - It is assumed that these objects are created and manipulated only within the context of a single thread. Therefore, no synchronization is required for access to internal collections.
| Field Summary | |
static java.lang.String |
GLOBAL_MESSAGE_KEY
|
| Method Summary | |
void |
add(Message message)
Add a message to the set of messages for the "global" property. |
void |
add(Messages messages)
Adds the messages from the given Messages object to
this set of messages. |
void |
add(java.lang.String property,
Message message)
Add a message to the set of messages for the specified property. |
void |
clear()
Clear all messages recorded by this object. |
boolean |
empty()
Deprecated. Use isEmpty instead. |
java.util.Iterator |
get()
Return the set of all recorded messages, without distinction by which property the messages are associated with. |
java.util.Iterator |
get(java.lang.String property)
Return the set of messages related to a specific property. |
boolean |
isEmpty()
Return true if there are no messages recorded
in this collection, or false otherwise. |
java.util.Iterator |
properties()
Return the set of property names for which at least one message has been recorded. |
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. |
| Field Detail |
public static final java.lang.String GLOBAL_MESSAGE_KEY
| Method Detail |
public void add(java.lang.String property,
Message message)
property - Property name (or Messages.GLOBAL_MESSAGE_KEY)message - The message to be addedpublic void add(Message message)
message - The message to be addedpublic void add(Messages messages)
Messages object to
this set of messages. The messages are added in the order they are returned from
the properties() method. If a message's property is already in the current
Messages object it is added to the end of the list for that
property. If a message's property is not in the current list it is added to the end
of the properties.
messages - The Messages object to be added.public void clear()
public boolean empty()
true if there are no messages recorded
in this collection, or false otherwise.
public boolean isEmpty()
true if there are no messages recorded
in this collection, or false otherwise.
public java.util.Iterator get()
public java.util.Iterator get(java.lang.String property)
property - Property name (or ActionMessages.GLOBAL_MESSAGE_KEY)public java.util.Iterator properties()
Messages.GLOBAL_MESSAGE will be one of the returned
property names.
public int size()
empty() if all you care about is whether or not there are
any messages at all.
public int size(java.lang.String property)
property - Property name (or Messages.GLOBAL_MESSAGE_KEY
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||