com.holonplatform.core.i18n

## Interface LocalizationContext.Builder

- Enclosing interface:
    LocalizationContext

      public static interface LocalizationContext.Builder

  Builder for `LocalizationContext` creation

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `LocalizationContext` | `build()` Build LocalizationContext instance
    `LocalizationContext.Builder` | `disableDateTimeFormatsCache()` Disable caching of date/time formatters
    `LocalizationContext.Builder` | `messageArgumentsPlaceholder(String placeholder)` Set localized message arguments placehoder.
    `default LocalizationContext.Builder` | `messageProvider(MessageProvider messageProvider)` Deprecated. Use `withMessageProvider(MessageProvider)`
    `LocalizationContext.Builder` | `withDefaultBooleanLocalization(boolean value, Localizable message)` Sets the default `Localizable` message to use to localize a boolean value
    `LocalizationContext.Builder` | `withDefaultDateTemporalFormat(TemporalFormat format)` Set the default `TemporalFormat` style to use to format dates.
    `LocalizationContext.Builder` | `withDefaultTimeTemporalFormat(TemporalFormat format)` Set the default `TemporalFormat` style to use to format times.
    `LocalizationContext.Builder` | `withInitialLocale(Locale locale)` Initialize context with given Locale
    `LocalizationContext.Builder` | `withInitialLocalization(Localization localization)` Initialize context with given Localization
    `LocalizationContext.Builder` | `withInitialSystemLocale()` Initialize context with current system default Locale
    `LocalizationContext.Builder` | `withLocalizationChangeListener(LocalizationContext.LocalizationChangeListener listener)` Add a `LocalizationContext.LocalizationChangeListener` to listen for localization changes.
    `LocalizationContext.Builder` | `withMessageProvider(MessageProvider messageProvider)` Add a `MessageProvider` for messages localization.
    `LocalizationContext.Builder` | `withMissingMessageLocalizationListener(LocalizationContext.MissingMessageLocalizationListener listener)` Add a `LocalizationContext.MissingMessageLocalizationListener` to be notified when a message localization is not provided by any of the `MessageProvider`s registered in the `LocalizationContext`.

- - ### Method Detail

    - #### withInitialLocale

          LocalizationContext.Builder withInitialLocale(Locale locale)

      Initialize context with given Locale
      Parameters:
        `locale` - Locale
      Returns:
        this

    - #### withInitialLocalization

          LocalizationContext.Builder withInitialLocalization(Localization localization)

      Initialize context with given Localization
      Parameters:
        `localization` - Localization
      Returns:
        this

    - #### withInitialSystemLocale

          LocalizationContext.Builder withInitialSystemLocale()

      Initialize context with current system default Locale
      Returns:
        this

    - #### withDefaultBooleanLocalization

          LocalizationContext.Builder withDefaultBooleanLocalization(boolean value,
                                                                     Localizable message)

      Sets the default `Localizable` message to use to localize a boolean value
      Parameters:
        `value` - Boolean value
        `message` - The localizable message to use to localize given boolean value
      Returns:
        this

    - #### withDefaultDateTemporalFormat

          LocalizationContext.Builder withDefaultDateTemporalFormat(TemporalFormat format)

      Set the default `TemporalFormat` style to use to format dates.

      This is overriden by any `Localization.getDefaultDateTemporalFormat()` value.

      Parameters:
        `format` - Defalt date format style
      Returns:
        this

    - #### withDefaultTimeTemporalFormat

          LocalizationContext.Builder withDefaultTimeTemporalFormat(TemporalFormat format)

      Set the default `TemporalFormat` style to use to format times.

      This is overriden by any `Localization.getDefaultTimeTemporalFormat()` value.

      Parameters:
        `format` - Defalt time format style
      Returns:
        this

    - #### disableDateTimeFormatsCache

          LocalizationContext.Builder disableDateTimeFormatsCache()

      Disable caching of date/time formatters
      Returns:
        this

    - #### messageArgumentsPlaceholder

          LocalizationContext.Builder messageArgumentsPlaceholder(String placeholder)

      Set localized message arguments placehoder. Default is `MessageProvider.DEFAULT_MESSAGE_ARGUMENT_PLACEHOLDER`.
      Parameters:
        `placeholder` - Placeholder for message arguments
      Returns:
        this

    - #### withMessageProvider

          LocalizationContext.Builder withMessageProvider(MessageProvider messageProvider)

      Add a `MessageProvider` for messages localization.
      Parameters:
        `messageProvider` - The MessageProvider to add
      Returns:
        this

    - #### messageProvider

          @Deprecated
          default LocalizationContext.Builder messageProvider(MessageProvider messageProvider)

      Deprecated. Use `withMessageProvider(MessageProvider)`
      Add a MessageProvider for messages localization
      Parameters:
        `messageProvider` - MessageProvider to add
      Returns:
        this

    - #### withLocalizationChangeListener

          LocalizationContext.Builder withLocalizationChangeListener(LocalizationContext.LocalizationChangeListener listener)

      Add a `LocalizationContext.LocalizationChangeListener` to listen for localization changes.
      Parameters:
        `listener` - The listener to add (not null)
      Returns:
        this

    - #### withMissingMessageLocalizationListener

          LocalizationContext.Builder withMissingMessageLocalizationListener(LocalizationContext.MissingMessageLocalizationListener listener)

      Add a `LocalizationContext.MissingMessageLocalizationListener` to be notified when a message localization is not provided by any of the `MessageProvider`s registered in the `LocalizationContext`.
      Parameters:
        `listener` - The listener to add (not null)
      Returns:
        this

    - #### build

          LocalizationContext build()

      Build LocalizationContext instance
      Returns:
        LocalizationContext

Copyright © 2019 The Holon Platform. All rights reserved.