All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.util.MessageFormatter

java.lang.Object
   |
   +----com.ibm.beans.util.MessageFormatter

public class MessageFormatter
extends Object
The MessageFormatter class is a convenience class used to format messages with imbedded variables. It formats messages with up to three variable arguments.


Constructor Index

 o MessageFormatter(String)
Constructs a MessageFormatter that loads the specified resource bundle.

Method Index

 o format(String)
Retrieve a message from the ResourceBundle instance.
 o format(String, Object)
Format a message with one variable argument.
 o format(String, Object, Object)
Format a message with two variable arguments.
 o format(String, Object, Object, Object)
Format a message with three variable arguments.
 o getResourceBundleName()
Retrieve the ResourceBundle baseName.

Constructors

 o MessageFormatter
 public MessageFormatter(String resourceBundleName)
Constructs a MessageFormatter that loads the specified resource bundle.

Parameters:
resourceBundleName - The package-qualified class name of the ResourceBundle class.

Methods

 o format
 public String format(String msgHandle)
Retrieve a message from the ResourceBundle instance.

Parameters:
msgHandle - The string that is the key for retrieving a message from the ResourceBundle instance.
Returns:
A message String retrieved from the ResourceBundle instance.
 o format
 public String format(String msgHandle,
                      Object arg)
Format a message with one variable argument.

Parameters:
msgHandle - The string that is the key for retrieving a message from the ResourceBundle instance.
arg - An object reference to the variable argument.
Returns:
A formatted String with the variable argument substituted.
 o format
 public String format(String msgHandle,
                      Object arg1,
                      Object arg2)
Format a message with two variable arguments.

Parameters:
msgHandle - The string that is the key for retrieving a message from the ResourceBundle instance.
arg1 - An object reference to the first variable argument.
arg2 - An object reference to the second variable argument.
Returns:
A formatted String with the variable arguments substituted.
 o format
 public String format(String msgHandle,
                      Object arg1,
                      Object arg2,
                      Object arg3)
Format a message with three variable arguments.

Parameters:
msgHandle - The string that is the key for retrieving the message from the ResourceBundle instance.
arg1 - An object reference to the first variable argument.
arg2 - An object reference to the second variable argument.
arg3 - An object reference to the third variable argument.
Returns:
A formatted String with the variable arguments substituted.
 o getResourceBundleName
 public String getResourceBundleName()
Retrieve the ResourceBundle baseName. This was the original input parameter to the MessageFormatter constructor and was used in the ResourceBundle.getBundle() method to get the appropriate ResourceBundle instance.

Returns:
A String with the ResourceBundle baseName.

All Packages  Class Hierarchy  This Package  Previous  Next  Index