|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.jdo.I18NHelper
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 msg = I18NHelper.getInstance("javax.jdo.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 (msg.msg("ERR_NoMetadata", cls.getName()));
Method Summary | |
static I18NHelper |
getInstance(java.lang.Class cls)
Deprecated. An instance bound to a bundle. |
static I18NHelper |
getInstance(java.lang.String bundleName)
Deprecated. An instance bound to a bundle. |
static I18NHelper |
getInstance(java.lang.String bundleName,
java.lang.ClassLoader loader)
Deprecated. An instance bound to a bundle. |
java.lang.String |
msg(java.lang.String messageKey)
Deprecated. Message formatter |
java.lang.String |
msg(java.lang.String messageKey,
boolean arg)
Deprecated. Message formatter |
java.lang.String |
msg(java.lang.String messageKey,
int arg)
Deprecated. Message formatter |
java.lang.String |
msg(java.lang.String messageKey,
java.lang.Object arg1)
Deprecated. Message formatter |
java.lang.String |
msg(java.lang.String messageKey,
java.lang.Object[] args)
Deprecated. Message formatter |
java.lang.String |
msg(java.lang.String messageKey,
java.lang.Object arg1,
java.lang.Object arg2)
Deprecated. Message formatter |
java.lang.String |
msg(java.lang.String messageKey,
java.lang.Object arg1,
java.lang.Object arg2,
java.lang.Object arg3)
Deprecated. Message formatter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static I18NHelper getInstance(java.lang.String bundleName)
bundleName
- the name of the bundlepublic static I18NHelper getInstance(java.lang.Class cls)
null
.cls
- the class object from which to load the resource bundlepublic static I18NHelper getInstance(java.lang.String bundleName, java.lang.ClassLoader loader)
null
.bundleName
- the name of the bundleloader
- the class loader from which to load the resource
bundlepublic java.lang.String msg(java.lang.String messageKey)
messageKey
- the message keypublic java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1)
messageKey
- the message keyarg1
- the first argumentpublic java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2)
messageKey
- the message keyarg1
- the first argumentarg2
- the second argumentpublic java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
messageKey
- the message keyarg1
- the first argumentarg2
- the second argumentarg3
- the third argumentpublic java.lang.String msg(java.lang.String messageKey, java.lang.Object[] args)
messageKey
- the message keyargs
- the array of argumentspublic java.lang.String msg(java.lang.String messageKey, int arg)
messageKey
- the message keyarg
- the argumentpublic java.lang.String msg(java.lang.String messageKey, boolean arg)
messageKey
- the message keyarg
- the argument
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |