Package org.pentaho.di.i18n
Class GlobalMessages
java.lang.Object
org.pentaho.di.i18n.AbstractMessageHandler
org.pentaho.di.i18n.GlobalMessages
- All Implemented Interfaces:
MessageHandler
,Handler
- Direct Known Subclasses:
LAFMessageHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static GlobalMessages
static final String[]
static final String[]
protected static final Map<String,
ResourceBundle> protected static final LogChannelInterface
protected static Class<?>
protected static final String
-
Constructor Summary
ConstructorDescriptionTODO: extend from abstract class to ensure singleton status and migrate instantiation to class controlled private -
Method Summary
Modifier and TypeMethodDescriptionprotected static String
buildBundleName
(String packageName) protected String
calculateString
(String[] pkgNames, String key, Object[] parameters, Class<?> resourceClass) Returns the localized string for the givenkey
andparameters
in a bundle defined by the the concatenation of the package names defined inpackageName
andBUNDLE_NAME
(the first valid combination ofpackageName
+BUNDLE_NAME
wins), sing the providedresourceClass
's class loader.protected String
calculateString
(String packageName, String key, Object[] parameters) Returns the localized string for the givenkey
andparameters
in a bundle defined by the the concatenation ofpackageName
andBUNDLE_NAME
, using theGlobalMessages
class loader.protected String
calculateString
(String packageName, String key, Object[] parameters, Class<?> resourceClass) Returns the localized string for the givenkey
andparameters
in a bundle defined by the the concatenation ofpackageName
andBUNDLE_NAME
, using the providedresourceClass
's class loader.static ResourceBundle
Retrieve a resource bundle of the default or fail-over locale.static MessageHandler
protected static Map<String,
ResourceBundle> get a key from the default (System global) bundleget a key from the defined package bundle, by keyGet a string from the defined package bundle, by key and by a resource classget a key from the defined package bundle, by keyMethods inherited from class org.pentaho.di.i18n.AbstractMessageHandler
getLocale, setLocale
-
Field Details
-
PKG
-
SYSTEM_BUNDLE_PACKAGE
-
BUNDLE_NAME
- See Also:
-
locales
-
log
-
localeCodes
-
localeDescr
-
GMinstance
-
-
Constructor Details
-
GlobalMessages
public GlobalMessages()TODO: extend from abstract class to ensure singleton status and migrate instantiation to class controlled private
-
-
Method Details
-
getInstance
-
getLocales
-
buildBundleName
-
getBundle
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.
-
calculateString
Returns the localized string for the givenkey
andparameters
in a bundle defined by the the concatenation ofpackageName
andBUNDLE_NAME
, using theGlobalMessages
class loader.- Parameters:
packageName
- the package containing the localized messageskey
- the message key being looked upparameters
- parameters within the looked up message- Returns:
- the localized string for the given
key
andparameters
in a bundle defined by the the concatenation ofpackageName
andBUNDLE_NAME
, using theGlobalMessages
class loader.
-
calculateString
protected String calculateString(String packageName, String key, Object[] parameters, Class<?> resourceClass) Returns the localized string for the givenkey
andparameters
in a bundle defined by the the concatenation ofpackageName
andBUNDLE_NAME
, using the providedresourceClass
's class loader.- Parameters:
packageName
- the package containing the localized messageskey
- the message key being looked upparameters
- parameters within the looked up messageresourceClass
- the class whose class loader is used to getch the resource bundle- Returns:
- the localized string for the given
key
andparameters
in a bundle defined by the the concatenation ofpackageName
andBUNDLE_NAME
, using the providedresourceClass
's class loader.
-
calculateString
protected String calculateString(String[] pkgNames, String key, Object[] parameters, Class<?> resourceClass) Returns the localized string for the givenkey
andparameters
in a bundle defined by the the concatenation of the package names defined inpackageName
andBUNDLE_NAME
(the first valid combination ofpackageName
+BUNDLE_NAME
wins), sing the providedresourceClass
's class loader.- Parameters:
pkgNames
- an array of packages potentially containing the localized messages the first one found to contain the messages is the one that is used to localize the messagekey
- the message key being looked upparameters
- parameters within the looked up messageresourceClass
- the class whose class loader is used to getch the resource bundle- Returns:
- the localized string for the given
key
andparameters
in a bundle defined by the the concatenation of the package names defined inpackageName
andBUNDLE_NAME
(the first valid combination ofpackageName
+BUNDLE_NAME
wins), sing the providedresourceClass
's class loader
-
getString
Description copied from interface:MessageHandler
get a key from the default (System global) bundle- Returns:
-
getString
Description copied from interface:MessageHandler
get a key from the defined package bundle, by key- Returns:
-
getString
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:
-