|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface I18nResolver
This interface is responsible for resolving a message or key/argument pairs to their internationalized message.
| Method Summary | |
|---|---|
Message |
createMessage(String key,
Serializable... arguments)
Creates an instance of Message. |
MessageCollection |
createMessageCollection()
|
Map<String,String> |
getAllTranslationsForPrefix(String prefix)
Given a prefix, this method will return all translations where the key starts with the given prefix as key -> value mappings, using the default locale. |
Map<String,String> |
getAllTranslationsForPrefix(String prefix,
Locale locale)
Given a prefix, this method will return all translations where the key starts with the given prefix as key -> value mappings. |
String |
getRawText(String key)
Retrieve the unformatted message text associated with this key. |
String |
getText(Locale locale,
Message message)
Given a Message this method:
returns the i18ned text formatted with the message arguments if the message key can be resolved.
Otherwise, returns the message key (formatted with the message arguments).
|
String |
getText(Locale locale,
String key)
Does the same as getText(Locale, String, java.io.Serializable...) however it is needed for velocity. |
String |
getText(Locale locale,
String key,
Serializable... arguments)
Given a key and a list of arguments: this method returns the i18ned text formatted with the arguments if the key can be resolved. otherwise, the key itself will be returned (after formatting). Arguments may also be of the form Message which means they will be resolved as well before
being included as an argument. |
String |
getText(Message message)
Given a Message this method:
returns the i18ned text formatted with the message arguments if the message key can be resolved.
Otherwise, returns the message key (formatted with the message arguments).
Uses the default locale. |
String |
getText(String key)
Does the same as getText(String, java.io.Serializable...) however it is needed for velocity. |
String |
getText(String key,
Serializable... arguments)
Given a key and a list of arguments: this method returns the i18ned text formatted with the arguments if the key can be resolved. otherwise, the key itself will be returned (after formatting). Arguments may also be of the form Message which means they will be resolved as well before
being included as an argument. |
| Method Detail |
|---|
String getRawText(String key)
key - key for the i18ned message
String getText(String key,
Serializable... arguments)
Message which means they will be resolved as well before
being included as an argument. Uses the default locale.
key - key for the i18ned messagearguments - Optional list of arguments for the message.
String getText(Locale locale,
String key,
Serializable... arguments)
Message which means they will be resolved as well before
being included as an argument.
locale - the locale to use for the i18ned textkey - key for the i18ned messagearguments - Optional list of arguments for the message.
String getText(String key)
getText(String, java.io.Serializable...) however it is needed for velocity.
key - key for the i18ned message
String getText(Locale locale,
String key)
getText(Locale, String, java.io.Serializable...) however it is needed for velocity.
locale - the locale to use for the i18ned textkey - key for the i18ned message
String getText(Message message)
Message this method:
message - The message to i18n
String getText(Locale locale,
Message message)
Message this method:
locale - the locale to use for the i18ned textmessage - The message to i18n
Message createMessage(String key,
Serializable... arguments)
key - The message keyarguments - The arguments to interpolate
MessageCollection createMessageCollection()
Map<String,String> getAllTranslationsForPrefix(String prefix)
prefix - The prefix for a particular key to start with. Empty string will match everything, which may be
slow. Throws NullPointerException if null.
NullPointerException - if link is null
Map<String,String> getAllTranslationsForPrefix(String prefix,
Locale locale)
prefix - The prefix for a particular key to start with. Empty string will match everything, which may be
slow. Throws NullPointerException if null.locale - The locale for which to lookup translations. Throws NullPointerException if null.
NullPointerException - if prefix or link are null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||