org.datanucleus.util
Class Localiser

java.lang.Object
  extended by org.datanucleus.util.Localiser

public class Localiser
extends java.lang.Object

Resource Bundle manager, providing simplified means of using MessageFormat to localise the system.


Method Summary
static Localiser getInstance(java.lang.String bundle_name, java.lang.ClassLoader class_loader)
          Accessor for a helper instance for a bundle.
 java.lang.String msg(boolean includeCode, java.lang.String messageKey)
          Message formatter for an internationalised message.
 java.lang.String msg(boolean includeCode, java.lang.String messageKey, long arg)
          Message formatter with one argument passed in that will be embedded in an internationalised message.
 java.lang.String msg(boolean includeCode, java.lang.String messageKey, java.lang.Object arg1)
          Message formatter with one argument passed in that will be embedded in an internationalised message.
 java.lang.String msg(boolean includeCode, java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2)
          Message formatter with a series of arguments passed in that will be embedded in an internationalised message.
 java.lang.String msg(boolean includeCode, java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Message formatter with a series of arguments passed in that will be embedded in an internationalised message.
 java.lang.String msg(boolean includeCode, java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Message formatter with a series of arguments passed in that will be embedded in an internationalised message.
 java.lang.String msg(boolean includeCode, java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Message formatter with a series of arguments passed in that will be embedded in an internationalised message.
 java.lang.String msg(java.lang.String messageKey)
          Message formatter for an internationalised message.
 java.lang.String msg(java.lang.String messageKey, long arg)
          Message formatter with one argument passed in that will be embedded in an internationalised message.
 java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1)
          Message formatter with one argument passed in that will be embedded in an internationalised message.
 java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2)
          Message formatter with a series of arguments passed in that will be embedded in an internationalised message.
 java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Message formatter with a series of arguments passed in that will be embedded in an internationalised message.
 java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Message formatter with a series of arguments passed in that will be embedded in an internationalised message.
 java.lang.String msg(java.lang.String messageKey, java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Message formatter with a series of arguments passed in that will be embedded in an internationalised message.
static void setDisplayCodesInMessages(boolean display)
          Method to allow turning on/off of display of error codes in messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDisplayCodesInMessages

public static void setDisplayCodesInMessages(boolean display)
Method to allow turning on/off of display of error codes in messages.

Parameters:
display - Whether to display codes

getInstance

public static Localiser getInstance(java.lang.String bundle_name,
                                    java.lang.ClassLoader class_loader)
Accessor for a helper instance for a bundle.

Parameters:
bundle_name - the name of the bundle
class_loader - the class loader from which to load the resource bundle
Returns:
the helper instance bound to the bundle

msg

public java.lang.String msg(boolean includeCode,
                            java.lang.String messageKey)
Message formatter for an internationalised message.

Parameters:
includeCode - Whether to include the code in the message
messageKey - the message key
Returns:
the resolved message text

msg

public java.lang.String msg(boolean includeCode,
                            java.lang.String messageKey,
                            long arg)
Message formatter with one argument passed in that will be embedded in an internationalised message.

Parameters:
includeCode - Whether to include the code in the message
messageKey - the message key
arg - the argument
Returns:
the resolved message text

msg

public java.lang.String msg(boolean includeCode,
                            java.lang.String messageKey,
                            java.lang.Object arg1)
Message formatter with one argument passed in that will be embedded in an internationalised message.

Parameters:
includeCode - Whether to include the code in the message
messageKey - the message key
arg1 - the first argument
Returns:
the resolved message text

msg

public java.lang.String msg(boolean includeCode,
                            java.lang.String messageKey,
                            java.lang.Object arg1,
                            java.lang.Object arg2)
Message formatter with a series of arguments passed in that will be embedded in an internationalised message.

Parameters:
includeCode - Whether to include the code in the message
messageKey - the message key
arg1 - the first argument
arg2 - the second argument
Returns:
the resolved message text

msg

public java.lang.String msg(boolean includeCode,
                            java.lang.String messageKey,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3)
Message formatter with a series of arguments passed in that will be embedded in an internationalised message.

Parameters:
includeCode - Whether to include the code in the message
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(boolean includeCode,
                            java.lang.String messageKey,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3,
                            java.lang.Object arg4)
Message formatter with a series of arguments passed in that will be embedded in an internationalised message.

Parameters:
includeCode - Whether to include the code in the message
messageKey - the message key
arg1 - the first argument
arg2 - the second argument
arg3 - the third argument
arg4 - the third argument
Returns:
the resolved message text

msg

public java.lang.String msg(boolean includeCode,
                            java.lang.String messageKey,
                            java.lang.Object arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3,
                            java.lang.Object arg4,
                            java.lang.Object arg5)
Message formatter with a series of arguments passed in that will be embedded in an internationalised message.

Parameters:
includeCode - Whether to include the code in the message
messageKey - the message key
arg1 - the first argument
arg2 - the second argument
arg3 - the third argument
arg4 - the third argument
arg5 - the third argument
Returns:
the resolved message text

msg

public java.lang.String msg(java.lang.String messageKey)
Message formatter for an internationalised message.

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 with one argument passed in that will be embedded in an internationalised message.

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 with a series of arguments passed in that will be embedded in an internationalised message.

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 with a series of arguments passed in that will be embedded in an internationalised message.

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 arg1,
                            java.lang.Object arg2,
                            java.lang.Object arg3,
                            java.lang.Object arg4)
Message formatter with a series of arguments passed in that will be embedded in an internationalised message.

Parameters:
messageKey - the message key
arg1 - the first argument
arg2 - the second argument
arg3 - the third argument
arg4 - the third 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,
                            java.lang.Object arg4,
                            java.lang.Object arg5)
Message formatter with a series of arguments passed in that will be embedded in an internationalised message.

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

msg

public java.lang.String msg(java.lang.String messageKey,
                            long arg)
Message formatter with one argument passed in that will be embedded in an internationalised message.

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


Copyright © 2009. All Rights Reserved.