public class Messages extends ResourceBundleSupport
| Constructor and Description |
|---|
Messages(java.util.Locale locale,
java.util.ResourceBundle resourceBundle)
Creates a new Messages-collection.
|
Messages(java.util.Locale locale,
java.util.ResourceBundle resourceBundle,
java.lang.String baseName)
Creates a new Messages-collection.
|
Messages(java.util.Locale locale,
java.lang.String baseName)
Creates a new Messages-collection.
|
Messages(java.util.ResourceBundle resourceBundle)
Creates a new Messages-collection.
|
Messages(java.util.ResourceBundle resourceBundle,
java.lang.String baseName)
Creates a new Messages-collection.
|
Messages(java.lang.String baseName)
Creates a new Messages-collection.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
formatErrorMessage(java.lang.String key,
java.lang.String msg)
Get a formatted error message.
|
java.lang.String |
getErrorString(java.lang.String key)
Get a formatted error message from the resource-bundle.
|
java.lang.String |
getErrorString(java.lang.String key,
java.lang.String param1)
Get a parametrized formatted error message from the resource-bundle.
|
java.lang.String |
getErrorString(java.lang.String key,
java.lang.String param1,
java.lang.String param2)
Get a parametrized formatted error message from the resource-bundle.
|
java.lang.String |
getErrorString(java.lang.String key,
java.lang.String param1,
java.lang.String param2,
java.lang.String param3)
Get a parametrized formatted error message from the resource-bundle.
|
java.lang.String |
getString(java.lang.String key)
Gets a string for the given key from this resource bundle or one of its parents.
|
java.lang.String |
getString(java.lang.String key,
java.lang.String param1)
Formats the message stored in the resource bundle (using a MessageFormat).
|
java.lang.String |
getString(java.lang.String key,
java.lang.String param1,
java.lang.String param2)
Formats the message stored in the resource bundle (using a MessageFormat).
|
java.lang.String |
getString(java.lang.String key,
java.lang.String param1,
java.lang.String param2,
java.lang.String param3)
Formats the message stored in the resource bundle (using a MessageFormat).
|
java.lang.String |
getString(java.lang.String key,
java.lang.String param1,
java.lang.String param2,
java.lang.String param3,
java.lang.String param4)
Formats the message stored in the resource bundle (using a MessageFormat).
|
createMenu, formatMessage, formatMessage, formatMessage, getIcon, getIcon, getKeyStroke, getKeyStroke, getLocale, getMnemonic, getOptionalKeyStroke, getOptionalKeyStroke, getOptionalMnemonic, getResourceURLpublic Messages(java.util.Locale locale,
java.lang.String baseName)
locale - the locale.baseName - the baseName of the resource-bundle.ResourceBundle.getBundle(String, Locale)public Messages(java.util.Locale locale,
java.util.ResourceBundle resourceBundle,
java.lang.String baseName)
locale - the locale.baseName - the baseName of the resource-bundle.resourceBundle - a predefined resource-bundle.public Messages(java.util.Locale locale,
java.util.ResourceBundle resourceBundle)
locale - the locale.resourceBundle - a predefined resource-bundle.public Messages(java.lang.String baseName)
baseName - the baseName of the resource-bundle.public Messages(java.util.ResourceBundle resourceBundle,
java.lang.String baseName)
baseName - the baseName of the resource-bundle.resourceBundle - a predefined resource-bundle.public Messages(java.util.ResourceBundle resourceBundle)
resourceBundle - a predefined resource-bundle.public java.lang.String getString(java.lang.String key)
getString in class ResourceBundleSupportkey - the key for the desired stringjava.lang.NullPointerException - if key is nulljava.util.MissingResourceException - if no object for the given key can be foundpublic java.lang.String getString(java.lang.String key,
java.lang.String param1)
key - the resourcebundle keyparam1 - the parameter for the messagepublic java.lang.String getString(java.lang.String key,
java.lang.String param1,
java.lang.String param2)
key - the resourcebundle keyparam1 - the parameter for the messageparam2 - the parameter for the messagepublic java.lang.String getString(java.lang.String key,
java.lang.String param1,
java.lang.String param2,
java.lang.String param3)
key - the resourcebundle keyparam1 - the parameter for the messageparam2 - the parameter for the messageparam3 - the parameter for the messagepublic java.lang.String getString(java.lang.String key,
java.lang.String param1,
java.lang.String param2,
java.lang.String param3,
java.lang.String param4)
key - the resourcebundle keyparam1 - the parameter for the messageparam2 - the parameter for the messageparam3 - the parameter for the messageparam4 - the parameter for the messagepublic java.lang.String formatErrorMessage(java.lang.String key,
java.lang.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 java.lang.String getErrorString(java.lang.String key)
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.public java.lang.String getErrorString(java.lang.String key,
java.lang.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 messagepublic java.lang.String getErrorString(java.lang.String key,
java.lang.String param1,
java.lang.String param2)
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 messageparam2 - the parameter for the messagepublic java.lang.String getErrorString(java.lang.String key,
java.lang.String param1,
java.lang.String param2,
java.lang.String param3)
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 messageparam2 - the parameter for the messageparam3 - the parameter for the message