public class DefaultLocalizationBundleFactory extends Object implements LocalizationBundleFactory
BootstrapPropertyResolver| Modifier and Type | Field and Description |
|---|---|
static String |
BUNDLE_NAME
The name of the default resource bundle for Stripes.
|
static String |
ERROR_MESSAGE_BUNDLE
The configuration parameter for changing the default error message resource bundle.
|
static String |
FIELD_NAME_BUNDLE
The configuration parameter for changing the default field name resource bundle.
|
| Constructor and Description |
|---|
DefaultLocalizationBundleFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected Configuration |
getConfiguration() |
ResourceBundle |
getErrorMessageBundle(Locale locale)
Looks for a bundle called StripesResources with the supplied locale if one is provided,
or with the default locale if the locale provided is null.
|
ResourceBundle |
getFormFieldBundle(Locale locale)
Looks for a bundle called StripesResources with the supplied locale if one is provided,
or with the default locale if the locale provided is null.
|
void |
init(Configuration configuration)
Uses the BootstrapPropertyResolver attached to the Configuration in order to look for
configured bundle names in the servlet init parameters etc.
|
protected void |
setConfiguration(Configuration configuration) |
public static final String BUNDLE_NAME
public static final String ERROR_MESSAGE_BUNDLE
public static final String FIELD_NAME_BUNDLE
public void init(Configuration configuration) throws Exception
init in interface ConfigurableComponentconfiguration - the Configuration object being used by StripesException - should be thrown if the component cannot be configured well enough to use.public ResourceBundle getErrorMessageBundle(Locale locale) throws MissingResourceException
getErrorMessageBundle in interface LocalizationBundleFactorylocale - an optional locale, may be null.MissingResourceException - if a suitable bundle cannot be foundpublic ResourceBundle getFormFieldBundle(Locale locale) throws MissingResourceException
getFormFieldBundle in interface LocalizationBundleFactorylocale - an optional locale, may be null.MissingResourceException - if a suitable bundle cannot be foundprotected Configuration getConfiguration()
protected void setConfiguration(Configuration configuration)
© Copyright 2005-2006, Stripes Development Team.