Class LocaleServiceImpl

  • All Implemented Interfaces:
    LocaleService

    @NonNullByDefault
    public class LocaleServiceImpl
    extends Object
    implements LocaleService
    LocaleServiceImpl provides helper method for working with locales in REST resources.
    Author:
    Dennis Nobel - Initial contribution, Markus Rathgeb - Use locale provider, Martin Herbst - Support of different language definition variants
    • Constructor Detail

      • LocaleServiceImpl

        public LocaleServiceImpl()
    • Method Detail

      • getLocale

        public Locale getLocale​(@Nullable String acceptLanguageHttpHeader)
        Description copied from interface: LocaleService
        Returns the locale in respect to the given "Accept-Language" HTTP header.
        Specified by:
        getLocale in interface LocaleService
        Returns:
        Locale for the "Accept-Language" HTTP header or default locale if header is not set or can not be parsed.
      • setLocaleProvider

        protected void setLocaleProvider​(LocaleProvider provider)
      • unsetLocaleProvider

        protected void unsetLocaleProvider​(LocaleProvider provider)