org.springframework.context.i18n

## Class SimpleLocaleContext

- java.lang.Object
- - org.springframework.context.i18n.SimpleLocaleContext

- All Implemented Interfaces:
    LocaleContext
  Direct Known Subclasses:
    SimpleTimeZoneAwareLocaleContext

      public class SimpleLocaleContext
      extends Object
      implements LocaleContext

  Simple implementation of the `LocaleContext` interface, always returning a specified `Locale`.
  Since:
    1.2
  Author:
    Juergen Hoeller
  See Also:
    `LocaleContextHolder.setLocaleContext(org.springframework.context.i18n.LocaleContext)`, `LocaleContextHolder.getLocale()`, `SimpleTimeZoneAwareLocaleContext`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleLocaleContext(Locale locale)` Create a new SimpleLocaleContext that exposes the specified Locale.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Locale` | `getLocale()` Return the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleLocaleContext

          public SimpleLocaleContext(Locale locale)

      Create a new SimpleLocaleContext that exposes the specified Locale. Every `getLocale()` call will return this Locale.
      Parameters:
        `locale` - the Locale to expose

  - ### Method Detail

    - #### getLocale

          public Locale getLocale()

      Description copied from interface: `LocaleContext`
      Return the current Locale, which can be fixed or determined dynamically, depending on the implementation strategy.
      Specified by:
        `getLocale` in interface `LocaleContext`
      Returns:
        the current Locale, or `null` if no specific Locale associated

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`