public class Messages extends ResourceBundleSupport
Constructor and Description |
---|
Messages(Locale locale,
ResourceBundle resourceBundle,
String baseName)
Deprecated.
Always provide the classloader to be safe when deployed in weird setups. This method will be removed
after the next release.
|
Messages(Locale locale,
String baseName)
Deprecated.
Always provide the classloader to be safe when deployed in weird setups. This method will be removed
after the next release.
|
Messages(Locale locale,
String baseName,
ClassLoader classLoader)
Creates a new Messages-collection.
|
Modifier and Type | Method and Description |
---|---|
String |
formatErrorMessage(String key,
String msg)
Get a formatted error message.
|
String |
getErrorString(String key,
String... param1)
Get a parametrized formatted error message from the resource-bundle.
|
String |
getString(String key,
String... param1)
Formats the message stored in the resource bundle (using a MessageFormat).
|
createMenu, formatMessage, formatMessage, formatMessage, getIcon, getIcon, getKeyStroke, getKeyStroke, getLocale, getMnemonic, getOptionalKeyStroke, getOptionalKeyStroke, getOptionalMnemonic, getOptionalString, getResourceURL, getString, getString, getString, getString, strictString
public Messages(Locale locale, String baseName, ClassLoader classLoader)
locale
- the locale.baseName
- the baseName of the resource-bundle.ResourceBundle.getBundle(String, Locale)
public Messages(Locale locale, String baseName)
locale
- the locale.baseName
- the baseName of the resource-bundle.ResourceBundle.getBundle(String, Locale)
public Messages(Locale locale, ResourceBundle resourceBundle, String baseName)
locale
- the locale.baseName
- the baseName of the resource-bundle.resourceBundle
- a predefined resource-bundle.public String getString(String key, String... param1)
key
- the resourcebundle keyparam1
- the parameter for the messagepublic String formatErrorMessage(String key, String msg)
msg
parameter.
Currently the format is:
error key - error msg
For instance:
"0068 - A test error message."
Currently the format is: error key - error msg For instance: "0069 - You were punched by the donkey."key
- String containing the key that was used to obtain the msg
parameter from the resource
file.msg
- String containing the message that was obtained from the resource file using the key
parameter.public String getErrorString(String key, String... param1)
msg
parameter.
Currently the format is: error key - error msg For instance: "0069 - You were punched by the donkey."key
- String containing the key that was used to obtain the msg
parameter from the resource
file.param1
- the parameter for the message