|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.libraries.base.util.ResourceBundleSupport
org.pentaho.reporting.libraries.base.util.Messages
public class Messages
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.
Constructor Summary | |
---|---|
Messages(Locale locale,
ResourceBundle resourceBundle)
Creates a new Messages-collection. |
|
Messages(Locale locale,
ResourceBundle resourceBundle,
String baseName)
Creates a new Messages-collection. |
|
Messages(Locale locale,
String baseName)
Creates a new Messages-collection. |
|
Messages(ResourceBundle resourceBundle)
Creates a new Messages-collection. |
|
Messages(ResourceBundle resourceBundle,
String baseName)
Creates a new Messages-collection. |
|
Messages(String baseName)
Creates a new Messages-collection. |
Method Summary | |
---|---|
String |
formatErrorMessage(String key,
String msg)
Get a formatted error message. |
String |
getErrorString(String key)
Get a formatted error message from the resource-bundle. |
String |
getErrorString(String key,
String param1)
Get a parametrized formatted error message from the resource-bundle. |
String |
getErrorString(String key,
String param1,
String param2)
Get a parametrized formatted error message from the resource-bundle. |
String |
getErrorString(String key,
String param1,
String param2,
String param3)
Get a parametrized formatted error message from the resource-bundle. |
String |
getString(String key)
Gets a string for the given key from this resource bundle or one of its parents. |
String |
getString(String key,
String param1)
Formats the message stored in the resource bundle (using a MessageFormat). |
String |
getString(String key,
String param1,
String param2)
Formats the message stored in the resource bundle (using a MessageFormat). |
String |
getString(String key,
String param1,
String param2,
String param3)
Formats the message stored in the resource bundle (using a MessageFormat). |
String |
getString(String key,
String param1,
String param2,
String param3,
String param4)
Formats the message stored in the resource bundle (using a MessageFormat). |
Methods inherited from class org.pentaho.reporting.libraries.base.util.ResourceBundleSupport |
---|
createMenu, formatMessage, formatMessage, formatMessage, getIcon, getIcon, getKeyStroke, getKeyStroke, getLocale, getMnemonic, getOptionalKeyStroke, getOptionalKeyStroke, getOptionalMnemonic, getResourceURL |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 Messages(Locale locale, ResourceBundle resourceBundle)
locale
- the locale.resourceBundle
- a predefined resource-bundle.public Messages(String baseName)
baseName
- the baseName of the resource-bundle.public Messages(ResourceBundle resourceBundle, String baseName)
baseName
- the baseName of the resource-bundle.resourceBundle
- a predefined resource-bundle.public Messages(ResourceBundle resourceBundle)
resourceBundle
- a predefined resource-bundle.Method Detail |
---|
public String getString(String key)
getString
in class ResourceBundleSupport
key
- the key for the desired string
NullPointerException
- if key
is null
MissingResourceException
- if no object for the given key can be foundpublic String getString(String key, String param1)
key
- the resourcebundle keyparam1
- the parameter for the message
public String getString(String key, String param1, String param2)
key
- the resourcebundle keyparam1
- the parameter for the messageparam2
- the parameter for the message
public String getString(String key, String param1, String param2, String param3)
key
- the resourcebundle keyparam1
- the parameter for the messageparam2
- the parameter for the messageparam3
- the parameter for the message
public String getString(String key, String param1, String param2, String param3, 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 message
public 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)
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 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
public String getErrorString(String key, String param1, 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 message
public String getErrorString(String key, String param1, String param2, 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |