org.codehaus.plexus.i18n

Class DefaultI18N

public class DefaultI18N extends AbstractLogEnabled implements I18N, Initializable

UNKNOWN: role="org.codehaus.plexus.i18n.I18N"

Method Summary
Stringformat(String key, Object arg1)
Stringformat(String key, Object arg1, Object arg2)
Stringformat(String bundleName, Locale locale, String key, Object arg1)
Stringformat(String bundleName, Locale locale, String key, Object arg1, Object arg2)
Stringformat(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.
ResourceBundlegetBundle()
ResourceBundlegetBundle(String bundleName)
ResourceBundlegetBundle(String bundleName, String languageHeader)
This method returns a ResourceBundle given the bundle name and the Locale information supplied in the HTTP "Accept-Language" header.
ResourceBundlegetBundle(String bundleName, Locale locale)
This method returns a ResourceBundle for the given bundle name and the given Locale.
String[]getBundleNames()
StringgetDefaultBundleName()
StringgetDefaultCountry()
StringgetDefaultLanguage()
LocalegetLocale(String header)
StringgetString(String key)
StringgetString(String key, Locale locale)
StringgetString(String bundleName, Locale locale, String key)
protected StringgetStringOrNull(ResourceBundle rb, String key)
Gets localized text from a bundle if it's there.
voidinitialize()
Called the first time the Service is used.
protected voidinitializeBundleNames()

Method Detail

format

public String format(String key, Object arg1)

format

public String format(String key, Object arg1, Object arg2)

format

public String format(String bundleName, Locale locale, String key, Object arg1)

See Also: I18N

format

public String format(String bundleName, Locale locale, String key, Object arg1, Object arg2)

See Also: 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.

Returns: Localized, formatted text identified by key.

getBundle

public ResourceBundle getBundle()

getBundle

public ResourceBundle getBundle(String bundleName)

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.

Parameters: bundleName Name of bundle. languageHeader A String with the language header.

Returns: A localized ResourceBundle.

getBundle

public ResourceBundle getBundle(String bundleName, Locale locale)
This method returns a ResourceBundle for the given bundle name and the given Locale.

Parameters: 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).

Returns: A localized ResourceBundle.

getBundleNames

public String[] getBundleNames()

getDefaultBundleName

public String getDefaultBundleName()

getDefaultCountry

public String getDefaultCountry()

getDefaultLanguage

public String getDefaultLanguage()

getLocale

public Locale getLocale(String header)

See Also: getLocale

getString

public String getString(String key)

getString

public String getString(String key, Locale locale)

getString

public String getString(String bundleName, Locale locale, String key)

Throws: MissingResourceException Specified key cannot be matched.

See Also: 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()
Called the first time the Service is used.

initializeBundleNames

protected void initializeBundleNames()
Copyright © 2001-2008 Codehaus. All Rights Reserved.