Class AbstractEnumTextResolverWithOverrideAndFallback

    • Field Detail

      • DEFAULT_CHECK_FOR_OVERRIDE

        public static final boolean DEFAULT_CHECK_FOR_OVERRIDE
        See Also:
        Constant Field Values
      • DEFAULT_CHECK_FOR_FALLBACK

        public static final boolean DEFAULT_CHECK_FOR_FALLBACK
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractEnumTextResolverWithOverrideAndFallback

        protected AbstractEnumTextResolverWithOverrideAndFallback()
    • Method Detail

      • isCheckForOverride

        public final boolean isCheckForOverride()
      • setCheckForOverride

        public final void setCheckForOverride​(boolean bCheckForOverride)
      • isCheckForFallback

        public final boolean isCheckForFallback()
      • setCheckForFallback

        public final void setCheckForFallback​(boolean bCheckForFallback)
      • internalGetOverrideString

        @Nullable
        protected abstract String internalGetOverrideString​(@Nonnull
                                                            String sID,
                                                            @Nonnull
                                                            Locale aContentLocale)
        This method must return the override string for the passed parameters. This method is only called if isCheckForOverride() is true .
        Parameters:
        sID - Unique string ID
        aContentLocale - locale to use.
        Returns:
        The string in the passed locale. May be null.
      • internalGetFallbackString

        @Nullable
        protected abstract String internalGetFallbackString​(@Nonnull
                                                            String sID,
                                                            @Nonnull
                                                            Locale aContentLocale)
        This method must return the fallback string for the passed parameters. This method is only called if isCheckForFallback() is true .
        Parameters:
        sID - Unique string ID
        aContentLocale - locale to use.
        Returns:
        The string in the passed locale. May be null.
      • getText

        @Nullable
        public final String getText​(@Nonnull
                                    Enum<?> aEnum,
                                    @Nonnull
                                    IHasText aTP,
                                    @Nonnull
                                    Locale aContentLocale)
        Description copied from interface: IEnumTextResolver
        Get the text of an enumeration item.
        Specified by:
        getText in interface IEnumTextResolver
        Parameters:
        aEnum - The enumeration item to get the unique ID of. May not be null.
        aTP - The text provider containing the text. May not be null.
        aContentLocale - The locale to be used. May not be null.
        Returns:
        null if no text could be resolved.