public class MessageUtil extends Object
Constructor and Description |
---|
MessageUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
formatErrorMessage(String key,
String msg)
Get a formatted error message.
|
static String |
formatMessage(String pattern,
Object... params) |
static String |
getErrorString(ResourceBundle bundle,
String key)
Get a message from the specified resource bundle using the specified key, and format it.
|
static String |
getErrorString(ResourceBundle bundle,
String key,
Object... params) |
static String |
getString(ResourceBundle bundle,
String key)
Get the message from the specified resource bundle using the specified key.
|
static String |
getString(ResourceBundle bundle,
String key,
Object... params) |
public static String formatErrorMessage(String key, String msg)
msg
parameter.
Currently the format is: error key - error msg For instance: "0068 - A test error message."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 static String getString(ResourceBundle bundle, String key)
bundle
- ResourceBundle containing the desired Stringkey
- String containing the key to locate the desired String in the ResourceBundle.public static String getString(ResourceBundle bundle, String key, Object... params)
public static String getErrorString(ResourceBundle bundle, String key)
formatErrorMessage
for details on how the message is formatted.bundle
- ResourceBundle containing the desired Stringkey
- String containing the key to locate the desired String in the ResourceBundle.public static String getErrorString(ResourceBundle bundle, String key, Object... params)
Copyright © 2018 Hitachi Vantara. All rights reserved.