com.interface21.context.support
Class StaticMessageSource
java.lang.Object
|
+--com.interface21.context.support.AbstractNestingMessageSource
|
+--com.interface21.context.support.StaticMessageSource
- All Implemented Interfaces:
- MessageSource, NestingMessageSource
- public class StaticMessageSource
- extends AbstractNestingMessageSource
Simple implementation of NestingMessageSource that allows messages
to be held in a Java object, and added programmatically.
This class now supports internationalization.
Intended for testing, rather than use production systems.
- Author:
- Rod Johnson
|
Method Summary |
void |
addMessage(java.lang.String code,
java.util.Locale locale,
java.lang.String message)
Associate the given message with the given code. |
protected java.lang.String |
resolve(java.lang.String code,
java.util.Locale locale)
Subclasses must implement this method to resolve a message |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StaticMessageSource
public StaticMessageSource()
resolve
protected java.lang.String resolve(java.lang.String code,
java.util.Locale locale)
- Description copied from class:
AbstractNestingMessageSource
- Subclasses must implement this method to resolve a message
- Overrides:
resolve in class AbstractNestingMessageSource
- See Also:
AbstractNestingMessageSource.messageKey(Locale, String)
addMessage
public void addMessage(java.lang.String code,
java.util.Locale locale,
java.lang.String message)
- Associate the given message with the given code.
- Parameters:
code - lookup codelocale - locale message should be found withinmessage - message associated with this lookup code
Rod Johnson and Spring contributors 2001-2003.