|
||||||||||
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(java.lang.String key,
java.io.Serializable... arguments)
Creates an instance of Message. |
MessageCollection |
createMessageCollection()
|
java.util.Map<java.lang.String,java.lang.String> |
getAllTranslationsForPrefix(java.lang.String prefix,
java.util.Locale locale)
Given a prefix, this method will return all translations where the key starts with the given prefix as key -> value mappings. |
java.lang.String |
getText(Message message)
Given a Message this method returns the i18ned text if it can be resolved. |
java.lang.String |
getText(java.lang.String key)
Does the same as getText(String, java.io.Serializable[]) however it is needed for velocity. |
java.lang.String |
getText(java.lang.String key,
java.io.Serializable... arguments)
Given a key and a list of arguments this method returns the i18ned text if it can be resolved. |
Method Detail |
---|
java.lang.String getText(java.lang.String key, java.io.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.
java.lang.String getText(java.lang.String key)
getText(String, java.io.Serializable[])
however it is needed for velocity.
key
- key for the i18ned message
java.lang.String getText(Message message)
Message
this method returns the i18ned text if it can be resolved.
message
- The message to i18n
Message createMessage(java.lang.String key, java.io.Serializable... arguments)
key
- The message keyarguments
- The arguments to interpolate
MessageCollection createMessageCollection()
java.util.Map<java.lang.String,java.lang.String> getAllTranslationsForPrefix(java.lang.String prefix, java.util.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
.
java.lang.NullPointerException
- if prefix
or link
are null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |