| org.jfree.report.util.i18n.Messages
Messages | public class Messages extends ResourceBundleSupport (Code) | | A helper class for a simplified resource-bundle access. This class simply ignores all resource-bundle related errors
and prints place-holder strings if a localization key cannot be found.
author: David Kincade |
Method Summary | |
public String | formatErrorMessage(String key, String msg) Get a formatted error message. | public String | getErrorString(String key) Get a formatted error message from the resource-bundle. | public String | getErrorString(String key, String param1) Get a parametrized formatted error message from the resource-bundle. | public String | getErrorString(String key, String param1, String param2) Get a parametrized formatted error message from the resource-bundle. | public String | getErrorString(String key, String param1, String param2, String param3) Get a parametrized formatted error message from the resource-bundle. | public synchronized String | getString(String key) Gets a string for the given key from this resource bundle or one of its parents. | public String | getString(String key, String param1) Formats the message stored in the resource bundle (using a MessageFormat). | public String | getString(String key, String param1, String param2) Formats the message stored in the resource bundle (using a MessageFormat). | public String | getString(String key, String param1, String param2, String param3) Formats the message stored in the resource bundle (using a MessageFormat). | public String | getString(String key, String param1, String param2, String param3, String param4) Formats the message stored in the resource bundle (using a MessageFormat). |
Messages | public Messages(Locale locale, ResourceBundle resourceBundle, String baseName)(Code) | | Creates a new Messages-collection. The locale and baseName will be used to create the resource-bundle that backs up
this implementation.
Parameters: locale - the locale. Parameters: baseName - the baseName of the resource-bundle. Parameters: resourceBundle - a predefined resource-bundle. |
Messages | public Messages(Locale locale, ResourceBundle resourceBundle)(Code) | | Creates a new Messages-collection. The locale and baseName will be used to create the resource-bundle that backs up
this implementation.
Parameters: locale - the locale. Parameters: resourceBundle - a predefined resource-bundle. |
Messages | public Messages(String baseName)(Code) | | Creates a new Messages-collection. The default locale and baseName will be used to create the resource-bundle that
backs up this implementation.
Parameters: baseName - the baseName of the resource-bundle. |
Messages | public Messages(ResourceBundle resourceBundle, String baseName)(Code) | | Creates a new Messages-collection. The default locale and baseName will be used to create the resource-bundle that
backs up this implementation.
Parameters: baseName - the baseName of the resource-bundle. Parameters: resourceBundle - a predefined resource-bundle. |
Messages | public Messages(ResourceBundle resourceBundle)(Code) | | Creates a new Messages-collection. The default locale and baseName will be used to create the resource-bundle that
backs up this implementation.
Parameters: resourceBundle - a predefined resource-bundle. |
formatErrorMessage | public String formatErrorMessage(String key, String msg)(Code) | | Get a formatted error message. The message consists of two parts. The first part is the error numeric Id associated
with the key used to identify the message in the resource file. For instance, suppose the error key is
MyClass.ERROR_0069_DONKEY_PUNCH. The first part of the error msg would be "0069". The second part of the returned
string is simply the msg parameter.
Currently the format is: error key - error msg For instance: "0069 - You were punched by the donkey."
Parameters: key - String containing the key that was used to obtain the msg parameter from the resourcefile. Parameters: msg - String containing the message that was obtained from the resource file using the key parameter. String containing the formatted error message. |
getErrorString | public String getErrorString(String key)(Code) | | Get a formatted error message from the resource-bundle. The message consists of two parts. The first part is the
error numeric Id associated with the key used to identify the message in the resource file. For instance, suppose
the error key is MyClass.ERROR_0069_DONKEY_PUNCH. The first part of the error msg would be "0069". The second part
of the returned string is simply the msg parameter.
Currently the format is: error key - error msg For instance: "0069 - You were punched by the donkey."
Parameters: key - String containing the key that was used to obtain the msg parameter from the resourcefile. String containing the formatted error message. |
getErrorString | public String getErrorString(String key, String param1)(Code) | | Get a parametrized formatted error message from the resource-bundle. The message consists of two parts. The first
part is the error numeric Id associated with the key used to identify the message in the resource file. For
instance, suppose the error key is MyClass.ERROR_0069_DONKEY_PUNCH. The first part of the error msg would be
"0069". The second part of the returned string is simply the msg parameter.
Currently the format is: error key - error msg For instance: "0069 - You were punched by the donkey."
Parameters: key - String containing the key that was used to obtain the msg parameter from the resourcefile. Parameters: param1 - the parameter for the message String containing the formatted error message. |
getErrorString | public String getErrorString(String key, String param1, String param2)(Code) | | Get a parametrized formatted error message from the resource-bundle. The message consists of two parts. The first
part is the error numeric Id associated with the key used to identify the message in the resource file. For
instance, suppose the error key is MyClass.ERROR_0069_DONKEY_PUNCH. The first part of the error msg would be
"0069". The second part of the returned string is simply the msg parameter.
Currently the format is: error key - error msg For instance: "0069 - You were punched by the donkey."
Parameters: key - String containing the key that was used to obtain the msg parameter from the resourcefile. Parameters: param1 - the parameter for the message Parameters: param2 - the parameter for the message String containing the formatted error message. |
getErrorString | public String getErrorString(String key, String param1, String param2, String param3)(Code) | | Get a parametrized formatted error message from the resource-bundle. The message consists of two parts. The first
part is the error numeric Id associated with the key used to identify the message in the resource file. For
instance, suppose the error key is MyClass.ERROR_0069_DONKEY_PUNCH. The first part of the error msg would be
"0069". The second part of the returned string is simply the msg parameter.
Currently the format is: error key - error msg For instance: "0069 - You were punched by the donkey."
Parameters: key - String containing the key that was used to obtain the msg parameter from the resourcefile. Parameters: param1 - the parameter for the message Parameters: param2 - the parameter for the message Parameters: param3 - the parameter for the message String containing the formatted error message. |
getString | public synchronized String getString(String key)(Code) | | Gets a string for the given key from this resource bundle or one of its parents. If the key is a link, the link is
resolved and the referenced string is returned instead. If the given key cannot be resolved, no exception will be
thrown and a generic placeholder is used instead.
Parameters: key - the key for the desired string the string for the given key throws: NullPointerException - if key is null throws: MissingResourceException - if no object for the given key can be found |
getString | public String getString(String key, String param1)(Code) | | Formats the message stored in the resource bundle (using a MessageFormat).
Parameters: key - the resourcebundle key Parameters: param1 - the parameter for the message the formated string |
getString | public String getString(String key, String param1, String param2)(Code) | | Formats the message stored in the resource bundle (using a MessageFormat).
Parameters: key - the resourcebundle key Parameters: param1 - the parameter for the message Parameters: param2 - the parameter for the message the formated string |
getString | public String getString(String key, String param1, String param2, String param3)(Code) | | Formats the message stored in the resource bundle (using a MessageFormat).
Parameters: key - the resourcebundle key Parameters: param1 - the parameter for the message Parameters: param2 - the parameter for the message Parameters: param3 - the parameter for the message the formated string |
getString | public String getString(String key, String param1, String param2, String param3, String param4)(Code) | | Formats the message stored in the resource bundle (using a MessageFormat).
Parameters: key - the resourcebundle key Parameters: param1 - the parameter for the message Parameters: param2 - the parameter for the message Parameters: param3 - the parameter for the message Parameters: param4 - the parameter for the message the formated string |
|
|