com.holonplatform.core.i18n

## Interface Localizable

- All Known Subinterfaces:
    BeanProperty<T>, BeanProperty.Builder<T>, BooleanBeanProperty, BooleanProperty, BooleanProperty.BooleanPropertyBuilder, CloneableProperty<T,P,B>, CloneableProperty.CloneablePathProperty<T,P>, CollectionPathProperty<E,C>, CollectionProperty<E,C>, CollectionProperty.ListProperty<T>, CollectionProperty.SetProperty<T>, ListPathProperty<T>, ListPathProperty.ListPathPropertyBuilder<T>, ListVirtualProperty<T>, ListVirtualProperty.ListVirtualPropertyBuilder<T>, NumericBeanProperty<N>, NumericProperty<N>, NumericProperty.NumericPropertyBuilder<N>, PathProperty<T>, PathProperty.PathPropertyBuilder<T>, Property<T>, PropertyBoxProperty, PropertyBoxProperty.PropertyBoxPropertyBuilder, QueryFunction.Avg, QueryFunction.Count, QueryFunction.Max<T>, QueryFunction.Min<T>, QueryFunction.PropertyQueryFunction<T,A>, QueryFunction.Sum<T>, SetPathProperty<T>, SetPathProperty.SetPathPropertyBuilder<T>, SetVirtualProperty<T>, SetVirtualProperty.SetVirtualPropertyBuilder<T>, StringBeanProperty, StringFunction, StringFunction.Lower, StringFunction.Upper, StringProperty, StringProperty.StringPropertyBuilder, TemporalBeanProperty<T>, TemporalFunction.Day, TemporalFunction.Hour, TemporalFunction.Month, TemporalFunction.Year, TemporalProperty<T>, TemporalProperty.TemporalPropertyBuilder<T>, VirtualProperty<T>, VirtualProperty.Builder<T,P,B>, VirtualProperty.VirtualPropertyBuilder<T>
  All Known Implementing Classes:
    Validator.ValidationException, Validator.ValidationMessage

      public interface Localizable

  Provides message code, arguments and default value to obtain a localized message.
  Since:
    5.0.0
  See Also:
    `LocalizationContext`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Localizable.Builder<B extends Localizable.Builder<B>>` Base interface for `Localizable` building
    `static interface` | `Localizable.LocalizableBuilder` `Localizable` builder
    `static class` | `Localizable.LocalizationException` Exception thrown for localization related errors.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Localizable.LocalizableBuilder` | `builder()` Get a builder to create a `Localizable` instance
    `String` | `getMessage()` Get the default message to use if a `getMessageCode()` is not available or a localized message which corresponds to the message code cannot be found or no localization handler is available for message translation.
    `default Object[]` | `getMessageArguments()` Optional arguments to use for message localization.
    `String` | `getMessageCode()` Get the message code to use to obtain a localized message
    `static Localizable` | `of(String message)` Create a new `Localizable` with the default message only.
    `static Localizable` | `of(String message, String messageCode, Object... arguments)` Create a new `Localizable`.

- - ### Method Detail

    - #### getMessageCode

          String getMessageCode()

      Get the message code to use to obtain a localized message
      Returns:
        Message code

    - #### getMessage

          String getMessage()

      Get the default message to use if a `getMessageCode()` is not available or a localized message which corresponds to the message code cannot be found or no localization handler is available for message translation.
      Returns:
        Default message

    - #### getMessageArguments

          default Object[] getMessageArguments()

      Optional arguments to use for message localization.

      By default this method returns `null`. Override it to provide message localization arguments.

      Arguments resolution process is dependend from concrete localization handler. For example, a predefined argument placeholder character may be used to define arguments substitution positions within the localized message.

      Returns:
        Message localization arguments, or `null` if none

    - #### builder

          static Localizable.LocalizableBuilder builder()

      Get a builder to create a `Localizable` instance
      Returns:
        Localizable builder

    - #### of

          static Localizable of(String message,
                                String messageCode,
                                Object... arguments)

      Create a new `Localizable`.
      Parameters:
        `message` - Default message
        `messageCode` - Message translation code
        `arguments` - Optional message translation arguments
      Returns:
        A new `Localizable`

    - #### of

          static Localizable of(String message)

      Create a new `Localizable` with the default message only.
      Parameters:
        `message` - Default message
      Returns:
        A new `Localizable`

Copyright © 2019 The Holon Platform. All rights reserved.