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.
  • Constructor Details

    • XMLMessages

      public XMLMessages()
  • Method Details

    • setLocale

      public void setLocale(Locale locale)
      Set the Locale object to use.
      Parameters:
      locale - non-null reference to Locale object.
    • getLocale

      public Locale getLocale()
      Get the Locale object that is being used.
      Returns:
      non-null reference to Locale object.
    • createXMLMessage

      public static final String createXMLMessage(String msgKey, Object[] args)
      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