Class LocaleProvider


  • public abstract class LocaleProvider
    extends java.lang.Object
    Determines the locale, normally from the context.

    For example, in webapps, you might use the current request's Accept-Language header, or maybe it's just an invocation to Locale.getDefault().

    A single instance of LocaleProvider is maintained in this class for the use by ResourceBundleHolder.

    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • LocaleProvider

        public LocaleProvider()
    • Method Detail

      • get

        public abstract java.util.Locale get()
        Determines the locale to be used.
        Returns:
        must not be null.
      • getProvider

        public static LocaleProvider getProvider()
        Gets the currently installed system-wide LocaleProvider.
        Returns:
        always non-null.
      • getLocale

        public static java.util.Locale getLocale()
        Short for getProvider().get()