com.interface21.context.support
Class ResourceBundleMessageSource

java.lang.Object
  |
  +--com.interface21.context.support.AbstractNestingMessageSource
        |
        +--com.interface21.context.support.ResourceBundleMessageSource
All Implemented Interfaces:
MessageSource, NestingMessageSource

public class ResourceBundleMessageSource
extends AbstractNestingMessageSource

MessageSource that
This class is a JavaBean, exposing a 'basename' property.
This class relies on the caching of the underlying core library ResourceBundle implementation.

Version:
$RevisionId$
Author:
Rod Johnson

Constructor Summary
ResourceBundleMessageSource()
           
 
Method Summary
protected  java.lang.String resolve(java.lang.String code, java.util.Locale locale)
          Subclasses must implement this method to resolve a message
 void setBasename(java.lang.String basename)
          Set the basename property.
 java.lang.String toString()
          Show the state of this object.
 
Methods inherited from class com.interface21.context.support.AbstractNestingMessageSource
escape, getDefaultLocale, getMessage, getMessage, getMessage, localeKey, messageKey, messageKey, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceBundleMessageSource

public ResourceBundleMessageSource()
Method Detail

setBasename

public void setBasename(java.lang.String basename)
Set the basename property. The basename follows ResourceBundle conventions. It is a fully-qualified classname. If it doesn't contain a package qualifier (such as com.interface21.mypackage), it will be resolved from the default package. Messages will normally be held in the /lib or /classes directory of a WAR. They can also be held in Jars on the classpath. For example, a Jar in an application's manifest classpath could contain messages for the application.
Parameters:
basename - basename, following ResourceBundle conventions
See Also:
ResourceBundle

resolve

protected java.lang.String resolve(java.lang.String code,
                                   java.util.Locale locale)
                            throws java.util.MissingResourceException
Description copied from class: AbstractNestingMessageSource
Subclasses must implement this method to resolve a message
Overrides:
resolve in class AbstractNestingMessageSource
See Also:
AbstractNestingMessageSource.resolve(String, Locale)

toString

public java.lang.String toString()
Show the state of this object.
Overrides:
toString in class java.lang.Object


Rod Johnson and Spring contributors 2001-2003.