|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.aop.i18n.impl.MessagesImpl
public class MessagesImpl
The implementation of our Messages
interface.
Constructor Summary | |
---|---|
MessagesImpl(Locale locale,
PluralRule pluralRule,
ResourceBundle resources)
|
Method Summary | |
---|---|
String |
formatPluralString(double n,
String key,
Object... args)
Format the given localized message with possible plural forms with a set of arguments. |
String |
formatString(String key,
Object... args)
Format the given localized message with a set of arguments. |
Locale |
getLocale()
|
PluralRule |
getPluralRule()
|
String |
getPluralString(double n,
String key)
Find a localized message with possible plural forms. |
String |
getString(String key)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessagesImpl(Locale locale, PluralRule pluralRule, ResourceBundle resources)
Method Detail |
---|
public Locale getLocale()
getLocale
in interface Messages
public PluralRule getPluralRule()
getPluralRule
in interface Messages
public String getString(String key)
getString
in interface Messages
key
- The key to search for in the message catalog.
public String formatString(String key, Object... args)
Messages
String.format(i18n.getLocale(),i18n.getString(key),args)
formatString
in interface Messages
key
- The key to search for in the message catalog.args
- The argument to the format string.
public String getPluralString(double n, String key)
Messages
<key>.<tag>
, if the associated PluralRule
return a non-null plural tag like one
or zero
.
If a message for these special keys is not found or
the plural rule return NullPointerException
, the unmodified key
is used to fetch the message.
getPluralString
in interface Messages
n
- The plural denominator.key
- The key to search for in the message catalog.
public String formatPluralString(double n, String key, Object... args)
Messages
String.format(i18n.getLocale(),i18n.getPluralString(n,key),args)
formatPluralString
in interface Messages
n
- The plural denominator.key
- The key to search for in the message catalog.args
- The argument to the format string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |