|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.scaffold.util.MessagesImpl
public class MessagesImpl
Nested Class Summary | |
---|---|
protected class |
MessagesImpl.MessageItem
|
Field Summary | |
---|---|
protected int |
iCount
The current number of the property/key being added. |
protected HashMap |
messages
The accumulated set of Message objects (represented
as an ArrayList) for each property, keyed by property name. |
Fields inherited from interface org.apache.commons.scaffold.util.Messages |
---|
GLOBAL_MESSAGE_KEY |
Constructor Summary | |
---|---|
MessagesImpl()
Create an empty Messages object. |
|
MessagesImpl(Messages messages)
Create an AMessages object initialized with the given
messages. |
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(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()
Return true if there are no messages recorded
in this collection, or false otherwise. |
Iterator |
get()
Return the set of all recorded messages, without distinction by which property the messages are associated with. |
Iterator |
get(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. |
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(String property)
Return the number of messages associated with the specified property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HashMap messages
Message
objects (represented
as an ArrayList) for each property, keyed by property name.
protected int iCount
Constructor Detail |
---|
public MessagesImpl()
Messages
object.
public MessagesImpl(Messages messages)
AMessages
object initialized with the given
messages.
messages
- The messages to be initially added to this object.Method Detail |
---|
public void add(String property, Message message)
Messages
add
in interface Messages
property
- Property name (or Messages.GLOBAL_MESSAGE_KEY)message
- The message to be addedpublic void add(Message message)
Messages
add
in interface Messages
message
- The message to be addedpublic void add(Messages 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.
add
in interface Messages
messages
- The Messages
object to be added.public void clear()
Messages
clear
in interface Messages
public boolean empty()
Messages
true
if there are no messages recorded
in this collection, or false
otherwise.
empty
in interface Messages
public boolean isEmpty()
Messages
true
if there are no messages recorded
in this collection, or false
otherwise.
isEmpty
in interface Messages
public Iterator get()
Messages
get
in interface Messages
public Iterator get(String property)
Messages
get
in interface Messages
property
- Property name (or ActionMessages.GLOBAL_MESSAGE_KEY)public Iterator properties()
Messages
Messages.GLOBAL_MESSAGE
will be one of the returned
property names.
properties
in interface Messages
public int size()
Messages
empty()
if all you care about is whether or not there are
any messages at all.
size
in interface Messages
public int size(String property)
Messages
size
in interface Messages
property
- Property name (or Messages.GLOBAL_MESSAGE_KEY
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |