org.springframework.context.support
Class StaticMessageSource

org.springframework.context.support.AbstractNestingMessageSource
  |
  +--org.springframework.context.support.StaticMessageSource

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
 voidaddMessage(String code, Locale locale, String message)
          Associate the given message with the given code.
 StringtoString()
           

Methods inherited from class org.springframework.context.support.AbstractNestingMessageSource
getMessage, getMessage, getMessage, setParent, setUseCodeAsDefaultMessage

Method Detail

addMessage

public void addMessage(String code, Locale locale, String message)
Associate the given message with the given code.
Parameters:
code - lookup code
locale - locale message should be found within
message - message associated with this lookup code

toString

public String toString()

Association Links

to Class java.util.Map