public class DefaultLocalizationBundleFactory extends java.lang.Object implements LocalizationBundleFactory
BootstrapPropertyResolver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BUNDLE_NAME
The name of the default resource bundle for Stripes.
|
static java.lang.String |
ERROR_MESSAGE_BUNDLE
The configuration parameter for changing the default error message resource bundle.
|
static java.lang.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() |
java.util.ResourceBundle |
getErrorMessageBundle(java.util.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.
|
java.util.ResourceBundle |
getFormFieldBundle(java.util.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 java.lang.String BUNDLE_NAME
public static final java.lang.String ERROR_MESSAGE_BUNDLE
public static final java.lang.String FIELD_NAME_BUNDLE
public void init(Configuration configuration) throws java.lang.Exception
init
in interface ConfigurableComponent
configuration
- the Configuration object being used by Stripesjava.lang.Exception
- should be thrown if the component cannot be configured well enough to use.public java.util.ResourceBundle getErrorMessageBundle(java.util.Locale locale) throws java.util.MissingResourceException
getErrorMessageBundle
in interface LocalizationBundleFactory
locale
- an optional locale, may be null.java.util.MissingResourceException
- if a suitable bundle cannot be foundpublic java.util.ResourceBundle getFormFieldBundle(java.util.Locale locale) throws java.util.MissingResourceException
getFormFieldBundle
in interface LocalizationBundleFactory
locale
- an optional locale, may be null.java.util.MissingResourceException
- if a suitable bundle cannot be foundprotected Configuration getConfiguration()
protected void setConfiguration(Configuration configuration)
? Copyright 2005-2006, Stripes Development Team.