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
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static GlobalMessagesstatic final String[]static final String[]protected static final Map<String,ResourceBundle> protected static final LogChannelInterfaceprotected static Class<?>protected static final String -
Constructor Summary
ConstructorsConstructorDescriptionTODO: extend from abstract class to ensure singleton status and migrate instantiation to class controlled private -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringbuildBundleName(String packageName) protected StringcalculateString(String[] pkgNames, String key, Object[] parameters, Class<?> resourceClass) Returns the localized string for the givenkeyandparametersin a bundle defined by the the concatenation of the package names defined inpackageNameandBUNDLE_NAME(the first valid combination ofpackageName+BUNDLE_NAMEwins), sing the providedresourceClass's class loader.protected StringcalculateString(String packageName, String key, Object[] parameters) Returns the localized string for the givenkeyandparametersin a bundle defined by the the concatenation ofpackageNameandBUNDLE_NAME, using theGlobalMessagesclass loader.protected StringcalculateString(String packageName, String key, Object[] parameters, Class<?> resourceClass) Returns the localized string for the givenkeyandparametersin a bundle defined by the the concatenation ofpackageNameandBUNDLE_NAME, using the providedresourceClass's class loader.static ResourceBundleRetrieve a resource bundle of the default or fail-over locale.static MessageHandlerprotected 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 givenkeyandparametersin a bundle defined by the the concatenation ofpackageNameandBUNDLE_NAME, using theGlobalMessagesclass 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
keyandparametersin a bundle defined by the the concatenation ofpackageNameandBUNDLE_NAME, using theGlobalMessagesclass loader.
-
calculateString
protected String calculateString(String packageName, String key, Object[] parameters, Class<?> resourceClass) Returns the localized string for the givenkeyandparametersin a bundle defined by the the concatenation ofpackageNameandBUNDLE_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
keyandparametersin a bundle defined by the the concatenation ofpackageNameandBUNDLE_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 givenkeyandparametersin a bundle defined by the the concatenation of the package names defined inpackageNameandBUNDLE_NAME(the first valid combination ofpackageName+BUNDLE_NAMEwins), 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
keyandparametersin a bundle defined by the the concatenation of the package names defined inpackageNameandBUNDLE_NAME(the first valid combination ofpackageName+BUNDLE_NAMEwins), sing the providedresourceClass's class loader
-
getString
Description copied from interface:MessageHandlerget a key from the default (System global) bundle- Returns:
-
getString
Description copied from interface:MessageHandlerget a key from the defined package bundle, by key- Returns:
-
getString
Description copied from interface:MessageHandlerget 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:MessageHandlerGet a string from the defined package bundle, by key and by a resource class- Returns:
-