format
public String format(String bundleName,
Locale locale,
String key,
Object arg1)
- format in interface I18N
format
public String format(String bundleName,
Locale locale,
String key,
Object arg1,
Object arg2)
- format in interface I18N
format
public String format(String bundleName,
Locale locale,
String key,
Object[] args)
Looks up the value for key
in the
ResourceBundle
referenced by
bundleName
, then formats that value for the
specified Locale
using args
.
- format in interface I18N
- Localized, formatted text identified by
key
.
format
public String format(String key,
Object arg1)
- format in interface I18N
format
public String format(String key,
Object arg1,
Object arg2)
- format in interface I18N
getBundle
public ResourceBundle getBundle()
- getBundle in interface I18N
getBundle
public ResourceBundle getBundle(String bundleName)
- getBundle in interface I18N
getBundle
public ResourceBundle getBundle(String bundleName,
Locale locale)
This method returns a ResourceBundle for the given bundle name
and the given Locale.
- getBundle in interface I18N
bundleName
- Name of bundle (or null
for the
default bundle).locale
- The locale (or null
for the locale
indicated by the default language and country).
- A localized ResourceBundle.
getBundle
public ResourceBundle getBundle(String bundleName,
String languageHeader)
This method returns a ResourceBundle given the bundle name and
the Locale information supplied in the HTTP "Accept-Language"
header.
- getBundle in interface I18N
bundleName
- Name of bundle.languageHeader
- A String with the language header.
- A localized ResourceBundle.
getLocale
public Locale getLocale(String header)
- getLocale in interface I18N
getString
public String getString(String key)
- getString in interface I18N
getString
public String getString(String key,
Locale locale)
- getString in interface I18N
getString
public String getString(String bundleName,
Locale locale,
String key)
- getString in interface I18N
getStringOrNull
protected final String getStringOrNull(ResourceBundle rb,
String key)
Gets localized text from a bundle if it's there. Otherwise,
returns null
(ignoring a possible
MissingResourceException
).
initialize
public void initialize()
throws InitializationException
Called the first time the Service is used.
initializeBundleNames
protected void initializeBundleNames()