Class AbstractHasText

    • Constructor Detail

      • AbstractHasText

        protected AbstractHasText()
    • Method Detail

      • internalGetLocaleToUseWithFallback

        @Nullable
        protected Locale internalGetLocaleToUseWithFallback​(@Nonnull
                                                            Locale aContentLocale)
        Determine the locale to use.
        Parameters:
        aContentLocale - Requested locale. Never null.
        Returns:
        The locale to use. May be null.
      • internalGetText

        @Nullable
        protected abstract String internalGetText​(@Nonnull
                                                  Locale aContentLocale)
        Main text resolving. Get the text in the passed locale.
        Parameters:
        aContentLocale - Locale to use. This is the locale resolved internally. Never null.
        Returns:
        null if no such text present in the passed locale
      • getText

        @Nullable
        public final String getText​(@Nonnull
                                    Locale aContentLocale)
        Description copied from interface: IHasText
        Get the text specific for the passed locale. The implementation class MAY add locale-generalisation when resolving the text ("de_DE" => "de" => default).
        Specified by:
        getText in interface IHasText
        Parameters:
        aContentLocale - The locale to use. May not be null.
        Returns:
        null if no text for the given locale was found.