| com.mockrunner.struts.MapMessageResources
MapMessageResources | public class MapMessageResources extends MessageResources (Code) | | This implementation of MessageResources
takes the messages from a Map and can be
used for testing purposes. The Map can
also be filled with the contents of a property file.
Note: This implementation ignores the specified Locale .
|
Method Summary | |
public void | clear() Clears all messages. | public String | getMessage(Locale locale, String key) Returns the message for the specified key. | public void | putMessage(String key, String value) Adds a message for the specified key. | public void | putMessages(Map messages) Adds all messages in the specified map. | public void | putMessages(String propertyFileName) Loads a property file and adds all messages
from the file. | public void | putMessages(File propertyFile) Loads a property file and adds all messages
from the file. |
MapMessageResources | public MapMessageResources()(Code) | | Creates an empty resources object
|
MapMessageResources | public MapMessageResources(Map messages)(Code) | | Creates a resources object based on the specified
map.
Parameters: messages - the map of messages |
MapMessageResources | public MapMessageResources(Map messages, MessageResourcesFactory factory, String config)(Code) | | Creates a resources object based on the specified
map.
Parameters: messages - the map of messages Parameters: factory - the MessageResourcesFactory that created us Parameters: config - the configuration parameter |
MapMessageResources | public MapMessageResources(Map messages, MessageResourcesFactory factory, String config, boolean returnNull)(Code) | | Creates a resources object based on the specified
map.
Parameters: messages - the map of messages Parameters: factory - the MessageResourcesFactory that created us Parameters: config - the configuration parameter Parameters: returnNull - the returnNull property |
clear | public void clear()(Code) | | Clears all messages.
|
getMessage | public String getMessage(Locale locale, String key)(Code) | | Returns the message for the specified key. The locale
is ignored.
Parameters: locale - the locale (ignored) Parameters: key - the message key the message |
putMessage | public void putMessage(String key, String value)(Code) | | Adds a message for the specified key.
Parameters: key - the message key Parameters: value - the message |
putMessages | public void putMessages(Map messages)(Code) | | Adds all messages in the specified map.
Parameters: messages - the message map |
putMessages | public void putMessages(String propertyFileName)(Code) | | Loads a property file and adds all messages
from the file.
Parameters: propertyFileName - the file name |
putMessages | public void putMessages(File propertyFile)(Code) | | Loads a property file and adds all messages
from the file.
Parameters: propertyFile - the file |
|
|