Package org.codehaus.plexus.i18n
Class DefaultI18N
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.codehaus.plexus.i18n.DefaultI18N
- All Implemented Interfaces:
I18N,org.codehaus.plexus.logging.LogEnabled,org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
public class DefaultI18N
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements I18N, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
-
Field Summary
Fields inherited from interface org.codehaus.plexus.i18n.I18N
ACCEPT_LANGUAGE, ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLooks up the value forkeyin theResourceBundlereferenced bybundleName, then formats that value for the specifiedLocaleusingargs.This method returns a ResourceBundle given the bundle name and the Locale information supplied in the HTTP "Accept-Language" header.This method returns a ResourceBundle for the given bundle name and the given Locale.String[]protected final StringgetStringOrNull(ResourceBundle rb, String key) Gets localized text from a bundle if it's there.voidCalled the first time the Service is used.protected voidMethods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Constructor Details
-
DefaultI18N
public DefaultI18N()
-
-
Method Details
-
getDefaultLanguage
- Specified by:
getDefaultLanguagein interfaceI18N
-
getDefaultCountry
- Specified by:
getDefaultCountryin interfaceI18N
-
getDefaultBundleName
- Specified by:
getDefaultBundleNamein interfaceI18N
-
getBundleNames
- Specified by:
getBundleNamesin interfaceI18N
-
getBundle
-
getBundle
-
getBundle
This method returns a ResourceBundle given the bundle name and the Locale information supplied in the HTTP "Accept-Language" header. -
getBundle
This method returns a ResourceBundle for the given bundle name and the given Locale. -
getLocale
-
getString
-
getString
-
getString
- Specified by:
getStringin interfaceI18N- Throws:
MissingResourceException- Specified key cannot be matched.- See Also:
-
format
-
format
-
format
-
format
-
format
Looks up the value forkeyin theResourceBundlereferenced bybundleName, then formats that value for the specifiedLocaleusingargs. -
initialize
public void initialize() throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationExceptionCalled the first time the Service is used.- Specified by:
initializein interfaceorg.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable- Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
-
initializeBundleNames
protected void initializeBundleNames() -
getStringOrNull
Gets localized text from a bundle if it's there. Otherwise, returnsnull(ignoring a possibleMissingResourceException).
-