Movatterモバイル変換


[0]ホーム

URL:



          


Interface MessageList

All Known Implementing Classes:
BasicMessageList

public interfaceMessageList

A class that encapsulates messages. MessageList can be either global or they are specific to a particular bean property.

Each individual message is described by anMessage 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.

Orginally based on org.apache.struts.action.ActionMessages, Revision 49670.


GLOBAL_MESSAGE_KEY
          A default key to represent "global" messages that do not pertain to a particular property.
 
add(Message message)
          Add a message to the set of messages for the "global" property.
add(MessageList messages)
          Adds the messages from the givenMessageList object to this set of messages.
add(String property,Message message)
          Add a message to the set of messages for the specified property.
clear()
          Clear all messages recorded by this object.
get()
          Return the set of all recorded messages, without distinction by which property the messages are associated with.
get(String property)
          Return the set of messages related to a specific property.
getGlobalMessageKey()
           
isAccessed()
          Determines if the MessageList's messages have been accessed one or more times.
isEmpty()
           
properties()
          Return the set of property names for which at least one message has been recorded.
setGlobalMessageKey(String globalMessageKey)
           
size()
          Return the number of messages recorded for all properties (including global messages).
size(String property)
          Return the number of messages associated with the specified property.
 

GLOBAL_MESSAGE_KEY

static finalStringGLOBAL_MESSAGE_KEY
A default key to represent "global" messages that do not pertain to a particular property.

See Also:
Constant Field Values

getGlobalMessageKey

StringgetGlobalMessageKey()
Returns:
The default global message key

setGlobalMessageKey

voidsetGlobalMessageKey(String globalMessageKey)
Parameters:
globalMessageKey - The new default global message key

add

voidadd(String property,Message message)
Add a message to the set of messages for the specified property. An order of the property/key is maintained based on the initial addition of the property/key.

Parameters:
property - Property name (or MessageList.GLOBAL_MESSAGE_KEY)
message - The message to be added

add

voidadd(Message message)
Add a message to the set of messages for the "global" property. An order of the property/key is maintained based on the initial addition of the property/key.

Parameters:
message - The message to be added

add

voidadd(MessageList messages)
Adds the messages from the givenMessageList 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 currentMessageList 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.

Parameters:
messages - TheMessageList object to be added.

clear

voidclear()
Clear all messages recorded by this object.


isAccessed

booleanisAccessed()
Determines if the MessageList's messages have been accessed one or more times. Returnstrue if theget() orget(String) methods are called.

Returns:
true if the messages have been accessed one or more times.

isEmpty

booleanisEmpty()
Returns:
Returntrue if there are no messages recorded in this collection, orfalse otherwise.

get

Iteratorget()
Return the set of all recorded messages, without distinction by which property the messages are associated with. If there are no messages recorded, an empty enumeration is returned.

Returns:
All messages.

get

Iteratorget(String property)
Return the set of messages related to a specific property. If there are no such messages, an empty enumeration is returned.

Parameters:
property - Property name
Returns:
Messages related to a specific property.

properties

Iteratorproperties()
Return the set of property names for which at least one message has been recorded. If there are no messages, an empty Iterator is returned. If you have recorded global messages, the String value ofMessageList.GLOBAL_MESSAGE will be one of the returned property names.

Returns:
The property names.

size

intsize()
Return the number of messages recorded for all properties (including global messages).NOTE - it is more efficient to callisEmpty() if all you care about is whether or not there are any messages at all.

Returns:
The number of messages.

size

intsize(String property)
Return the number of messages associated with the specified property.

Parameters:
property - Property name (or MessageList.GLOBAL_MESSAGE_KEY
Returns:
The number of messages for a specific property.

          

Copyright © 2001-2010The Apache Software Foundation. All Rights Reserved.
[8]ページ先頭

©2009-2026 Movatter.jp