|
||||||||||
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 |
getText(Message message)
Given a Message this method:-
1) returns the i18ned text formatted with the message arguments if the message key can be resolved. |
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:- 1) this method returns the i18ned text formatted with the arguments if the key can be resolved. |
Method Detail |
---|
String getText(String key, Serializable... arguments)
Message
which means they will be resolved as well before
being included as an argument.
key
- 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(Message message)
Message
this method:-
1) returns the i18ned text formatted with the message arguments if the message key can be resolved.
2) Otherwise, returns the message key (formatted with the message arguments).
message
- 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 |