public class XMLMessages extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
BAD_CODE
String to use if a bad message code is used.
|
protected Locale |
fLocale
The local object to use.
|
protected static String |
FORMAT_FAILED
String to use if the message format operation failed.
|
Constructor and Description |
---|
XMLMessages() |
Modifier and Type | Method and Description |
---|---|
static String |
createMsg(ListResourceBundle fResourceBundle,
String msgKey,
Object[] args)
Creates a message from the specified key and replacement
arguments, localized to the given locale.
|
static String |
createXMLMessage(String msgKey,
Object[] 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.
|
protected static String |
getResourceSuffix(Locale locale)
Return the resource file suffic for the indicated locale
For most locales, this will be based the language code.
|
static ListResourceBundle |
loadResourceBundle(String className)
Return a named ResourceBundle for a particular locale.
|
void |
setLocale(Locale locale)
Set the Locale object to use.
|
protected Locale fLocale
protected static final String BAD_CODE
protected static final String FORMAT_FAILED
public void setLocale(Locale locale)
locale
- non-null reference to Locale object.public Locale getLocale()
public static final String createXMLMessage(String msgKey, Object[] args)
msgKey
- The key for the message text.args
- The arguments to be used as replacement text
in the message created.public static final String createMsg(ListResourceBundle fResourceBundle, String msgKey, Object[] args)
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.public static ListResourceBundle loadResourceBundle(String className) throws MissingResourceException
className
- The class name of the resource bundle.MissingResourceException
protected static String getResourceSuffix(Locale locale)
locale
- the localeCopyright © 2016 JBoss by Red Hat. All rights reserved.