Class LocaleAccessor

java.lang.Object
com.sap.cloud.sdk.cloudplatform.servlet.LocaleAccessor

public final class LocaleAccessor extends Object
Accessor for retrieving the current Locale.
  • Method Details

    • setLocaleFacade

      public static void setLocaleFacade(@Nullable LocaleFacade localeFacade)
      Replaces the default LocaleFacade instance.
      Parameters:
      localeFacade - An instance of LocaleFacade. Use null to reset the facade.
    • getCurrentLocale

      @Nonnull public static Locale getCurrentLocale()
      Returns the requested locale of the current HTTP request, or default locale of the server.
      Returns:
      The locale.
    • getCurrentLocales

      @Nonnull public static List<Locale> getCurrentLocales()
      Returns a list of locales indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client request doesn't provide an "Accept-Language" header, this method returns a list containing one locale, the default locale of the server.
      Returns:
      A list of locales.
    • getLocaleFacade

      @Nonnull public static LocaleFacade getLocaleFacade()
      The LocaleFacade instance.