org.pentaho.di.i18n
Class GlobalMessages

java.lang.Object
  extended by org.pentaho.di.i18n.AbstractMessageHandler
      extended by org.pentaho.di.i18n.GlobalMessages
All Implemented Interfaces:
MessageHandler, Handler
Direct Known Subclasses:
LAFMessageHandler

public class GlobalMessages
extends AbstractMessageHandler


Field Summary
static String[] localeCodes
           
static String[] localeDescr
           
 
Constructor Summary
GlobalMessages()
          TODO: extend from abstract class to ensure singleton status and migrate instantiation to class controlled private
 
Method Summary
static ResourceBundle getBundle(Locale locale, String packageName)
           
static ResourceBundle getBundle(Locale locale, String packageName, Class<?> resourceClass)
           
static ResourceBundle getBundle(String packageName)
          Retrieve a resource bundle of the default or fail-over locale.
static ResourceBundle getBundle(String packageName, Class<?> resourceClass)
          Retrieve a resource bundle of the default or fail-over locale.
static MessageHandler getInstance()
           
static Locale getLocale()
           
 String getString(String key)
          get a key from the default (System global) bundle
 String getString(String packageName, String key)
          get a key from the defined package bundle, by key
 String getString(String packageName, String key, Class<?> resourceClass, String... parameters)
          Get a string from the defined package bundle, by key and by a resource class
 String getString(String packageName, String key, String... parameters)
          get a key from the defined package bundle, by key
static void setLocale(Locale newLocale)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localeCodes

public static final String[] localeCodes

localeDescr

public static final String[] localeDescr
Constructor Detail

GlobalMessages

public GlobalMessages()
TODO: extend from abstract class to ensure singleton status and migrate instantiation to class controlled private

Method Detail

getInstance

public static MessageHandler getInstance()

getLocale

public static Locale getLocale()

setLocale

public static void setLocale(Locale newLocale)

getBundle

public static ResourceBundle getBundle(String packageName)
                                throws MissingResourceException
Retrieve a resource bundle of the default or fail-over locale.

Parameters:
packageName - The package to search in
Returns:
The resource bundle
Throws:
MissingResourceException - in case both resource bundles couldn't be found.

getBundle

public static ResourceBundle getBundle(String packageName,
                                       Class<?> resourceClass)
                                throws MissingResourceException
Retrieve a resource bundle of the default or fail-over locale.

Parameters:
packageName - The package to search in
resourceClass - the class to use to resolve the bundle
Returns:
The resource bundle
Throws:
MissingResourceException - in case both resource bundles couldn't be found.

getBundle

public static ResourceBundle getBundle(Locale locale,
                                       String packageName)
                                throws MissingResourceException
Throws:
MissingResourceException

getBundle

public static ResourceBundle getBundle(Locale locale,
                                       String packageName,
                                       Class<?> resourceClass)
                                throws MissingResourceException
Throws:
MissingResourceException

getString

public String getString(String key)
Description copied from interface: MessageHandler
get a key from the default (System global) bundle

Returns:

getString

public String getString(String packageName,
                        String key)
Description copied from interface: MessageHandler
get a key from the defined package bundle, by key

Returns:

getString

public String getString(String packageName,
                        String key,
                        String... parameters)
Description copied from interface: MessageHandler
get a key from the defined package bundle, by key

Returns:

getString

public String getString(String packageName,
                        String key,
                        Class<?> resourceClass,
                        String... parameters)
Description copied from interface: MessageHandler
Get a string from the defined package bundle, by key and by a resource class

Returns: