Package org.apache.xml.res
Class XMLMessages
java.lang.Object
org.apache.xml.res.XMLMessages
- Direct Known Subclasses:
XPATHMessages
A utility class for issuing XML error messages.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final String
createMsg
(ListResourceBundle fResourceBundle, String msgKey, Object[] args) Creates a message from the specified key and replacement arguments, localized to the given locale.static final String
createXMLMessage
(String msgKey, Object[] args) Creates a message from the specified key and replacement arguments, localized to the given locale.Get the Locale object that is being used.static ListResourceBundle
loadResourceBundle
(String className) Return a named ResourceBundle for a particular locale.void
Set the Locale object to use.
-
Constructor Details
-
XMLMessages
public XMLMessages()
-
-
Method Details
-
setLocale
Set the Locale object to use.- Parameters:
locale
- non-null reference to Locale object.
-
getLocale
Get the Locale object that is being used.- Returns:
- non-null reference to Locale object.
-
createXMLMessage
Creates a message from the specified key and replacement arguments, localized to the given locale.- Parameters:
msgKey
- The key for the message text.args
- The arguments to be used as replacement text in the message created.- Returns:
- The formatted message string.
-
createMsg
public static final String createMsg(ListResourceBundle fResourceBundle, String msgKey, Object[] args) Creates a message from the specified key and replacement arguments, localized to the given locale.- Parameters:
fResourceBundle
- The resource bundle to use.msgKey
- The message key to use.args
- The arguments to be used as replacement text in the message created.- Returns:
- The formatted message string.
-
loadResourceBundle
public static ListResourceBundle loadResourceBundle(String className) throws MissingResourceException Return a named ResourceBundle for a particular locale. This method mimics the behavior of ResourceBundle.getBundle().- Parameters:
className
- The class name of the resource bundle.- Returns:
- the ResourceBundle
- Throws:
MissingResourceException
-