javax.jdo
Class I18NHelper

java.lang.Object
  |
  +--javax.jdo.I18NHelper

public class I18NHelper
extends java.lang.Object

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.newInstance("javax.jdo.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.String bundleName)
          An instance bound to a bundle.
 java.lang.String msg(java.lang.String messageKey)
          Message formatter
 java.lang.String msg(java.lang.String messageKey, boolean arg)
          Message formatter
 java.lang.String msg(java.lang.String messageKey, int arg)
          Message formatter
 java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1)
          Message formatter
 java.lang.String msg(java.lang.String messageKey, java.lang.Object[] args)
          Message formatter
 java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2)
          Message formatter
 java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Message formatter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static I18NHelper getInstance(java.lang.String bundleName)
An instance bound to a bundle.

Parameters:
bundleName - the name of the bundle
Returns:
the helper instance bound to the bundle

msg

public java.lang.String msg(java.lang.String messageKey)
Message formatter

Parameters:
messageKey - the message key
Returns:
the resolved message text

msg

public java.lang.String msg(java.lang.String messageKey,
                            java.lang.Object arg1)
Message formatter

Parameters:
messageKey - the message key
arg1 - the first argument
Returns:
the resolved message text

msg

public java.lang.String msg(java.lang.String messageKey,
                            java.lang.Object arg1,
                            java.lang.Object arg2)
Message formatter

Parameters:
messageKey - the message key
arg1 - the first argument
arg2 - the second argument
Returns:
the resolved message text

msg

public java.lang.String msg(java.lang.String messageKey,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3)
Message formatter

Parameters:
messageKey - the message key
arg1 - the first argument
arg2 - the second argument
arg3 - the third argument
Returns:
the resolved message text

msg

public java.lang.String msg(java.lang.String messageKey,
                            java.lang.Object[] args)
Message formatter

Parameters:
messageKey - the message key
args - the array of arguments
Returns:
the resolved message text

msg

public java.lang.String msg(java.lang.String messageKey,
                            int arg)
Message formatter

Parameters:
messageKey - the message key
arg - the argument
Returns:
the resolved message text

msg

public java.lang.String msg(java.lang.String messageKey,
                            boolean arg)
Message formatter

Parameters:
messageKey - the message key
arg - the argument
Returns:
the resolved message text