public final class Messages extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
format(String text,
Locale locale,
Object... arguments)
Returns the formatted messages with placeholders substituted by argument values.
|
static String |
format(String text,
Object... arguments)
Returns the formatted messages with placeholders substituted by argument values.
|
static String |
get(JahiaTemplatesPackage pkg,
String key,
Locale locale)
Looks up the resource bundle key considering locale and current module.
|
static String |
get(JahiaTemplatesPackage pkg,
String key,
Locale locale,
String defaultValue)
Looks up the resource bundle key considering locale and current module.
|
static String |
get(ResourceBundle bundle,
String key,
String defaultValue)
Looks up the resource bundle key considering locale and specified
ResourceBundle instance. |
static String |
get(String primaryBundleName,
JahiaTemplatesPackage pkg,
String key,
Locale locale)
Looks up the resource bundle key considering locale, specified bundle name and current module.
|
static String |
get(String primaryBundleName,
JahiaTemplatesPackage pkg,
String key,
Locale locale,
String defaultValue)
Looks up the resource bundle key considering locale, specified bundle name and current module.
|
static String |
get(String bundle,
String key,
Locale locale)
Looks up the resource bundle key considering locale and specified bundle name.
|
static String |
get(String bundle,
String key,
Locale locale,
String defaultValue)
Looks up the resource bundle key considering locale and specified bundle name.
|
static String |
getInternal(String key,
Locale locale)
Looks up the resource bundle key in the
ResourceBundles.JAHIA_INTERNAL_RESOURCES bundle, considering locale. |
static String |
getInternal(String key,
Locale locale,
String defaultValue)
Looks up the resource bundle key in the
ResourceBundles.JAHIA_INTERNAL_RESOURCES bundle, considering locale. |
static String |
getInternalWithArguments(String key,
Locale locale,
Object... args)
Looks up the resource bundle key in the
ResourceBundles.JAHIA_INTERNAL_RESOURCES bundle, considering locale. |
static String |
getInternalWithArguments(String key,
String defaultValue,
Locale locale,
Object... args)
Looks up the resource bundle key in the
ResourceBundles.JAHIA_INTERNAL_RESOURCES bundle, considering locale. |
static String |
getNonEmpty(String bundle,
String key,
Locale locale)
Looks up the resource bundle key in the specified bundle, considering locale.
|
static String |
getTypes(String key,
Locale locale,
String defaultValue)
Looks up the resource bundle key in the
ResourceBundles.JAHIA_TYPES_RESOURCES bundle, considering locale. |
static String |
getWithArgs(ResourceBundle bundle,
String key,
Object... arguments)
Looks up the resource bundle key in the specified bundle.
|
static String |
getWithArgs(ResourceBundle bundle,
String key,
String defaultValue,
Object... arguments)
Looks up the resource bundle key in the specified bundle.
|
static String |
getWithArgs(String bundle,
String key,
Locale locale,
Object... arguments)
Looks up the resource bundle key in the specified bundle, considering locale.
|
static String |
interpolateResourceBundleMacro(String input,
Locale locale,
JahiaTemplatesPackage module)
Performs the interpolation (evaluation) of the resource bundle macro in the provided input.
|
public static String format(String text, Object... arguments)
text - the message text with placeholdersarguments - an array of arguments to be used for substitutionpublic static String format(String text, Locale locale, Object... arguments)
text - the message text with placeholderslocale - the current localearguments - an array of arguments to be used for substitutionpublic static String get(JahiaTemplatesPackage pkg, String key, Locale locale)
pkg - the current modulekey - the key to perform lookup forlocale - current localepublic static String get(JahiaTemplatesPackage pkg, String key, Locale locale, String defaultValue)
pkg - the current modulekey - the key to perform lookup forlocale - current localedefaultValue - the default value to return if the lookup has not found anythingpublic static String get(ResourceBundle bundle, String key, String defaultValue)
ResourceBundle instance. If not found the specified default
value is returned.bundle - the resource bundle key to lookup the keykey - the key to perform lookup forlocale - current localedefaultValue - the default value to return if the lookup has not found anythingpublic static String get(String primaryBundleName, JahiaTemplatesPackage pkg, String key, Locale locale)
primaryBundleName - the resource bundle name to perform lookup for the first turnpkg - the current modulekey - the key to perform lookup forlocale - current localedefaultValue - the default value to return if the lookup has not found anythingpublic static String get(String primaryBundleName, JahiaTemplatesPackage pkg, String key, Locale locale, String defaultValue)
primaryBundleName - the resource bundle name to perform lookup for the first turnpkg - the current modulekey - the key to perform lookup forlocale - current localedefaultValue - the default value to return if the lookup has not found anythingpublic static String get(String bundle, String key, Locale locale) throws MissingResourceException
bundle - the bundle name to perform the lookup, must use "resources" prefix i. e. resources.JahiaServerSettingskey - the key to perform lookup forlocale - current localeMissingResourceException - in case the key is not found in the specified bundlepublic static String get(String bundle, String key, Locale locale, String defaultValue)
bundle - the bundle name to perform the lookup, must use "resources" prefix i. e. resources.JahiaServerSettingskey - the key to perform lookup forlocale - current localedefaultValue - the default value to return if the lookup has not found anythingpublic static String getInternal(String key, Locale locale)
ResourceBundles.JAHIA_INTERNAL_RESOURCES bundle, considering locale. This method does
not throw MissingResourceException in case the key is not found, but rather returns the key itself.key - the key to perform lookup forlocale - current localegetNonEmpty(String, String, Locale)public static String getInternal(String key, Locale locale, String defaultValue)
ResourceBundles.JAHIA_INTERNAL_RESOURCES bundle, considering locale. If not found the
specified default value is returned.key - the key to perform lookup forlocale - current localedefaultValue - the default value to return if the lookup has not found anythingpublic static String getInternalWithArguments(String key, Locale locale, Object... args)
ResourceBundles.JAHIA_INTERNAL_RESOURCES bundle, considering locale. Additionally
placeholders are replaced with the provided arguments.key - the key to perform lookup forlocale - current localeargs - the arguments to replace placeholders withpublic static String getInternalWithArguments(String key, String defaultValue, Locale locale, Object... args)
ResourceBundles.JAHIA_INTERNAL_RESOURCES bundle, considering locale. Additionally
placeholders are replaced with the provided arguments.key - the key to perform lookup fordefaultValue - the default value to return if the lookup has not found anythinglocale - current localeargs - the arguments to replace placeholders withpublic static String getNonEmpty(String bundle, String key, Locale locale)
MissingResourceException in case the key is not found, but rather returns the key itself.bundle - the bundle name to perform the lookupkey - the key to perform lookup forlocale - current localepublic static String getTypes(String key, Locale locale, String defaultValue)
ResourceBundles.JAHIA_TYPES_RESOURCES bundle, considering locale. If not found the
specified default value is returned.key - the key to perform lookup forlocale - current localedefaultValue - the default value to return if the lookup has not found anythingpublic static String getWithArgs(ResourceBundle bundle, String key, Object... arguments) throws MissingResourceException
bundle - the bundle to perform the lookup inkey - the key to perform lookup forargs - the arguments to replace placeholders withMissingResourceExceptionpublic static String getWithArgs(ResourceBundle bundle, String key, String defaultValue, Object... arguments) throws MissingResourceException
bundle - the bundle to perform the lookup inkey - the key to perform lookup fordefaultValue - the default value to return if the lookup has not found anythingargs - the arguments to replace placeholders withMissingResourceExceptionpublic static String getWithArgs(String bundle, String key, Locale locale, Object... arguments) throws MissingResourceException
bundle - the bundle name to perform the lookupkey - the key to perform lookup forlocale - current localeargs - the arguments to replace placeholders withMissingResourceExceptionpublic static String interpolateResourceBundleMacro(String input, Locale locale, JahiaTemplatesPackage module)
input - the text to be interpolatedlocale - current localmodule - current moduleCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.