Formats a message with the specified arguments using the given
locale information.
if (fResourceBundle == null || locale != fLocale) {
if (locale != null) {
fResourceBundle = PropertyResourceBundle.getBundle("org.apache.xerces.impl.msg.XMLSchemaMessages", locale);
// memorize the most-recent locale
fLocale = locale;
}
if (fResourceBundle == null)
fResourceBundle = PropertyResourceBundle.getBundle("org.apache.xerces.impl.msg.XMLSchemaMessages");
}
String msg = fResourceBundle.getString(key);
if (arguments != null) {
try {
msg = java.text.MessageFormat.format(msg, arguments);
} catch (Exception e) {
msg = fResourceBundle.getString("FormatFailed");
msg += " " + fResourceBundle.getString(key);
}
}
if (msg == null) {
msg = fResourceBundle.getString("BadMessageKey");
throw new MissingResourceException(msg, "org.apache.xerces.impl.msg.SchemaMessages", key);
}
return msg;