public interface Messages
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Modifier and Type | Method and Description |
---|---|
void |
clearCache() |
java.lang.String |
findMessage(java.lang.String packs,
java.lang.String key,
java.util.Locale locale)
Returns localized message or null if not found.
|
java.lang.String |
formatMainMessage(java.lang.String key,
java.lang.Object... params)
Get localized message from main message pack and use it as a format string for parameters provided.
Locale is determined by the current user session. |
java.lang.String |
formatMessage(java.lang.Class caller,
java.lang.String key,
java.util.Locale locale,
java.lang.Object... params)
Get localized message and use it as a format string for parameters provided
|
java.lang.String |
formatMessage(java.lang.Class caller,
java.lang.String key,
java.lang.Object... params)
Get localized message and use it as a format string for parameters provided.
Locale is determined by the current user session. |
java.lang.String |
formatMessage(java.lang.String pack,
java.lang.String key,
java.util.Locale locale,
java.lang.Object... params)
Get localized message and use it as a format string for parameters provided
|
java.lang.String |
formatMessage(java.lang.String pack,
java.lang.String key,
java.lang.Object... params)
Get localized message and use it as a format string for parameters provided.
Locale is determined by the current user session. |
int |
getCacheSize() |
java.lang.String |
getMainMessage(java.lang.String key)
Returns localized message using main message pack.
Locale is determined by the current user session. |
java.lang.String |
getMainMessage(java.lang.String key,
java.util.Locale locale)
Returns localized message
|
java.lang.String |
getMainMessagePack() |
java.lang.String |
getMessage(java.lang.Class caller,
java.lang.String key)
Returns localized message.
Locale is determined by the current user session. |
java.lang.String |
getMessage(java.lang.Class caller,
java.lang.String key,
java.util.Locale locale)
Returns localized message
|
java.lang.String |
getMessage(java.lang.Enum caller)
Returns localized message.
Locale is determined by the current user session. |
java.lang.String |
getMessage(java.lang.Enum caller,
java.util.Locale locale)
Returns localized message
|
java.lang.String |
getMessage(java.lang.String pack,
java.lang.String key)
Returns localized message.
Locale is determined by the current user session. |
java.lang.String |
getMessage(java.lang.String packs,
java.lang.String key,
java.util.Locale locale)
Returns localized message
|
MessageTools |
getTools()
Convenient access to
MessageTools bean. |
static final java.lang.String NAME
MessageTools getTools()
MessageTools
bean.java.lang.String getMainMessagePack()
java.lang.String getMessage(java.lang.Class caller, java.lang.String key)
caller
- class determining the message pack as full package namekey
- message keyjava.lang.String formatMessage(java.lang.Class caller, java.lang.String key, java.lang.Object... params)
caller
- class determining the message pack as full package namekey
- message keyparams
- parameter valuesjava.lang.String getMessage(java.lang.Class caller, java.lang.String key, java.util.Locale locale)
caller
- class determining the message pack as full package namekey
- message keylocale
- message localejava.lang.String formatMessage(java.lang.Class caller, java.lang.String key, java.util.Locale locale, java.lang.Object... params)
caller
- class determining the message pack as full package namekey
- message keylocale
- message localeparams
- parameter valuesjava.lang.String getMessage(java.lang.Enum caller)
caller
- enum determining the message pack and key:
java.lang.String getMessage(java.lang.Enum caller, java.util.Locale locale)
caller
- enum determining the message pack and key:
locale
- message localejava.lang.String getMessage(java.lang.String pack, java.lang.String key)
pack
- package name to start searching the message. If the key is not found in this package,
it will be searched in parent package, and so forthkey
- message keyjava.lang.String getMainMessage(java.lang.String key)
key
- message keyjava.lang.String getMainMessage(java.lang.String key, java.util.Locale locale)
key
- message keylocale
- message localejava.lang.String formatMessage(java.lang.String pack, java.lang.String key, java.lang.Object... params)
pack
- package name to start searching the message. If the key is not found in this package,
it will be searched in parent package, and so forthkey
- message keyparams
- parameter valuesjava.lang.String formatMainMessage(java.lang.String key, java.lang.Object... params)
key
- message keyparams
- parameter valuesjava.lang.String getMessage(java.lang.String packs, java.lang.String key, java.util.Locale locale)
packs
- list of whitespace-separated package names. Searching of message is performed in reverse order -
starts from last name in the list. Each package is searched for the key, if the key is not found
in this package, it is searched in parent package, and so forthkey
- message keylocale
- message locale@Nullable java.lang.String findMessage(java.lang.String packs, java.lang.String key, @Nullable java.util.Locale locale)
packs
- list of whitespace-separated package names. Searching of message is performed in reverse order -
starts from last name in the list. Each package is searched for the key, if the key is not found
in this package, it is searched in parent package, and so forthkey
- message keylocale
- message locale. If null, current user locale is used.java.lang.String formatMessage(java.lang.String pack, java.lang.String key, java.util.Locale locale, java.lang.Object... params)
pack
- package name to start searching the message. If the key is not found in this package,
it will be searched in parent package, and so forthkey
- message keylocale
- message localeparams
- parameter valuesint getCacheSize()
void clearCache()