public static java.lang.String | buildMessage(java.lang.String localizationClassName, java.lang.String key, java.lang.Object[] arguments)Return the message for the given exception class and error number.
String message = key;
ResourceBundle bundle = null;
// JDK 1.1 MessageFormat can't handle null arguments
if (arguments != null) {
for (int i = 0; i < arguments.length; i++) {
if (arguments[i] == null) {
arguments[i] = "null";
}
}
}
bundle = ResourceBundle.getBundle("oracle.toplink.essentials.internal.localization.i18n." + localizationClassName + "Resource", Locale.getDefault());
try {
message = bundle.getString(key);
} catch (java.util.MissingResourceException mre) {
// Found bundle, but couldn't find translation.
// Get the current language's NoTranslationForThisLocale message.
bundle = ResourceBundle.getBundle("oracle.toplink.essentials.internal.localization.i18n.ToplinkLocalizationResource", Locale.getDefault());
String noTranslationMessage = bundle.getString("NoTranslationForThisLocale");
return MessageFormat.format(message, arguments) + noTranslationMessage;
}
return MessageFormat.format(message, arguments);
|