Package org.apache.xml.res
Class XMLMessages
java.lang.Object
org.apache.xml.res.XMLMessages
- Direct Known Subclasses:
XPATHMessages
public class XMLMessages extends Object
A utility class for issuing XML error messages.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description XMLMessages() -
Method Summary
Modifier and Type Method Description static StringcreateMsg(ListResourceBundle fResourceBundle, String msgKey, Object[] args)Creates a message from the specified key and replacement arguments, localized to the given locale.static StringcreateXMLMessage(String msgKey, Object[] args)Creates a message from the specified key and replacement arguments, localized to the given locale.LocalegetLocale()Get the Locale object that is being used.voidsetLocale(Locale locale)Set the Locale object to use.
-
Field Details
-
fLocale
The local object to use. -
BAD_CODE
String to use if a bad message code is used.- See Also:
- Constant Field Values
-
FORMAT_FAILED
String to use if the message format operation failed.- See Also:
- Constant Field Values
-
-
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.
-