MySQL 5.6.14 Source Code Document
|
Public Member Functions | |
String | message (String messageKey) |
String | message (String messageKey, Object arg1) |
String | message (String messageKey, Object arg1, Object arg2) |
String | message (String messageKey, Object...args) |
String | message (String messageKey, int arg) |
String | message (String messageKey, boolean arg) |
ResourceBundle | getResourceBundle () |
Static Public Member Functions | |
static I18NHelper | getInstance (String bundleName) |
static I18NHelper | getInstance (final Class<?> cls) |
static I18NHelper | getInstance (String bundleName, ClassLoader loader) |
Helper class for constructing messages from bundles. The intended usage of this class is to construct a new instance bound to a bundle, as in
I18NHelper local = I18NHelper.getInstance("com.mysql.clusterj.core.Bundle");
This call uses the class loader that loaded the I18NHelper class to find the specified Bundle. The class provides two overloaded getInstance methods allowing to specify a different class loader: getInstance(Class cls) looks for a bundle called "Bundle.properties" located in the package of the specified class object and getInstance(String bundleName,ClassLoader loader) uses the specified class loader to find the bundle.
Subsequently, instance methods can be used to format message strings using the text from the bundle, as in
throw new JDOFatalInternalException (local.message("ERR_NoMetadata", cls.getName()));
Definition at line 48 of file I18NHelper.java.
|
inlinestatic |
An instance bound to a bundle. This method uses the current class loader to find the bundle.
bundleName | the name of the bundle |
Definition at line 106 of file I18NHelper.java.
|
inlinestatic |
An instance bound to a bundle. This method figures out the bundle name for the class object's package and uses the class' class loader to find the bundle. Note, the specified class object must not be null
.
cls | the class object from which to load the resource bundle |
Definition at line 117 of file I18NHelper.java.
|
inlinestatic |
An instance bound to a bundle. This method uses the specified class loader to find the bundle. Note, the specified class loader must not be null
.
bundleName | the name of the bundle |
loader | the class loader from which to load the resource bundle |
Definition at line 137 of file I18NHelper.java.
|
inline |
Returns the resource bundle used by this I18NHelper.
Definition at line 213 of file I18NHelper.java.
Message formatter
messageKey | the message key |
Definition at line 154 of file I18NHelper.java.
Message formatter
messageKey | the message key |
arg1 | the first argument |
Definition at line 164 of file I18NHelper.java.
|
inline |
Message formatter
messageKey | the message key |
arg1 | the first argument |
arg2 | the second argument |
Definition at line 175 of file I18NHelper.java.
Message formatter
messageKey | the message key |
args | the array of arguments |
Definition at line 185 of file I18NHelper.java.
Message formatter
messageKey | the message key |
arg | the argument |
Definition at line 195 of file I18NHelper.java.
Message formatter
messageKey | the message key |
arg | the argument |
Definition at line 205 of file I18NHelper.java.