public final class TextProviderUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getHtml(com.atlassian.sal.api.message.I18nResolver i18nResolver,
String msg,
String... params) |
static String |
getHtml(com.opensymphony.xwork2.TextProvider textProvider,
String msg,
String... params) |
static String |
getText(com.atlassian.sal.api.message.I18nResolver i18nResolver,
String msg,
String... params) |
static String |
getText(String i18nKey) |
static String |
getText(com.opensymphony.xwork2.TextProvider textProvider,
String msg,
String... params) |
static com.opensymphony.xwork2.TextProvider |
getTextProvider() |
static Supplier<String> |
textSupplier(com.atlassian.sal.api.message.I18nResolver i18nResolver,
String key,
String... params)
|
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. |
public static String getText(com.opensymphony.xwork2.TextProvider textProvider, String msg, String... params)
public static String getText(com.atlassian.sal.api.message.I18nResolver i18nResolver, String msg, String... params)
public static Supplier<String> textSupplier(com.opensymphony.xwork2.TextProvider textProvider, String key, String... params)
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.textProvider
- A TextProvider instancekey
- Key to look up in the text providerparams
- Parameters for the given keypublic static Supplier<String> textSupplier(com.atlassian.sal.api.message.I18nResolver i18nResolver, String key, String... params)
public static String getHtml(com.opensymphony.xwork2.TextProvider textProvider, String msg, String... params)
public static String getHtml(com.atlassian.sal.api.message.I18nResolver i18nResolver, String msg, String... params)
public static com.opensymphony.xwork2.TextProvider getTextProvider()
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.