public class Messages extends Object
Constructor and Description |
---|
Messages() |
Modifier and Type | Method and Description |
---|---|
static String |
formatMessage(String bundleName,
String key)
A message is formatted, without arguments, using a MessageFormat string retrieved
from the named resource bundle using the given key.
|
static String |
formatMessage(String bundleName,
String key,
Object[] arg)
A message is formatted using a MessageFormat string retrieved from the named resource bundle
using the given key.
|
static void |
throwIllegalArgumentException(String packageName,
String key,
Object[] args)
Throws an IllegalArgumentException with a formatted String argument.
|
static void |
throwIllegalStateException(String packageName,
String key,
Object[] args)
Throws an IllegalStateException with a formatted String argument.
|
public static String formatMessage(String bundleName, String key, Object[] arg)
bundleName
- is the resource bundle name.key
- is the key of the MessageFormat string in the resource bundle.arg
- is an array of arguments passed to the MessageFormat.format method.public static String formatMessage(String bundleName, String key)
bundleName
- is the resource bundle name.key
- is the key of the MessageFormat string in the resource bundle.public static void throwIllegalArgumentException(String packageName, String key, Object[] args)
packageName
- is the package from which the error is thrown. The resource
bundle "ErrorMessages" in this package contains the error MessageFormat
string.key
- is the key of the MessageFormat string in the resource bundle.args
- is an array of arguments passed to the MessageFormat.format method.public static void throwIllegalStateException(String packageName, String key, Object[] args)
packageName
- is the package from which the error is thrown. The resource
bundle "ErrorMessages" in this package contains the error MessageFormat
string.key
- is the key of the MessageFormat string in the resource bundle.args
- is an array of arguments passed to the MessageFormat.format method.Copyright © 2020 Rogue Wave Software. All rights reserved.