org.apache.xml.res

Class XMLMessages

Known Direct Subclasses:
XPATHMessages

public class XMLMessages
extends java.lang.Object

A utility class for issuing XML error messages.

Method Summary

static String
createMsg(ListResourceBundle fResourceBundle, String msgKey, args[] )
Creates a message from the specified key and replacement arguments, localized to the given locale.
static String
createXMLMessage(String msgKey, args[] )
Creates a message from the specified key and replacement arguments, localized to the given locale.
Locale
getLocale()
Get the Locale object that is being used.
static ListResourceBundle
loadResourceBundle(String className)
Return a named ResourceBundle for a particular locale.
void
setLocale(Locale locale)
Set the Locale object to use.

Method Details

createMsg

public static final String createMsg(ListResourceBundle fResourceBundle,
                                     String msgKey,
                                     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.
Returns:
The formatted message string.

createXMLMessage

public static final String createXMLMessage(String msgKey,
                                            args[] )
Creates a message from the specified key and replacement arguments, localized to the given locale.
Parameters:
Returns:
The formatted message string.

getLocale

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

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

setLocale

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

Copyright B) 2004 Apache XML Project. All Rights Reserved.