Class TextProviderUtils


  • public final class TextProviderUtils
    extends Object
    • Method Detail

      • getText

        public static String getText​(com.opensymphony.xwork2.TextProvider textProvider,
                                     String msg,
                                     String... params)
      • getText

        public static String getText​(com.atlassian.sal.api.message.I18nResolver i18nResolver,
                                     String msg,
                                     String... params)
      • textSupplier

        public static Supplier<String> textSupplier​(com.opensymphony.xwork2.TextProvider textProvider,
                                                    String key,
                                                    String... params)
        One can utilize this method together with BambooPreconditions: BambooPreconditions.checkThat(1==1, ArithmeticException::new, textSupplier("arithmetic.incomplete", "1==1")); Thanks to a supplier creation of the error message is deferred until error condition actually occurs.
        Parameters:
        textProvider - A TextProvider instance
        key - Key to look up in the text provider
        params - Parameters for the given key
        Returns:
      • getHtml

        public static String getHtml​(com.opensymphony.xwork2.TextProvider textProvider,
                                     String msg,
                                     String... params)
      • getHtml

        public static String getHtml​(com.atlassian.sal.api.message.I18nResolver i18nResolver,
                                     String msg,
                                     String... params)
      • getTextProvider

        public static com.opensymphony.xwork2.TextProvider getTextProvider()
      • getText

        public static String getText​(String i18nKey)