BEA Systems, Inc.

com.beasys.commerce.axiom.util.i18n
Class MessageBundle

java.lang.Object
  |
  +--com.beasys.commerce.axiom.util.i18n.MessageBundle

public class MessageBundle
extends java.lang.Object

MessageBundle provides methods which facilitate the internationalization of client objects through retrieval of locale-specific static text and constructed messages.


Method Summary
static MessageBundle getInstance(java.lang.String baseName)
          Retrieves an instance of a MessageBundle, provided a base name from which the bundle can be constructed.
 java.lang.String getMessage(java.lang.Object[] args, java.lang.String key)
          Constructs a message using the provided arguments and a key into the message bundle's properties table.
 java.lang.String getString(java.lang.String key)
          Retrieves a static text segment using a key into the message bundle's properties table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MessageBundle getInstance(java.lang.String baseName)
Retrieves an instance of a MessageBundle, provided a base name from which the bundle can be constructed.
Parameters:
baseName - the class name used to retrieve the bundle. An example of a base name is "com.beasys.commerce.portal.jspbeans.i18n.GenPrefs", where a text file titled "GenPrefs.properties" exists in the "i18n" directory under the "com.beasys.commerce.portal.jspbeans" package.
Returns:
MessageBundle a constructed MessagseBundle

getMessage

public java.lang.String getMessage(java.lang.Object[] args,
                                   java.lang.String key)
Constructs a message using the provided arguments and a key into the message bundle's properties table.
Parameters:
args - the arguments used to construct the message. For example, {"Wednesday", "78"};
key - the key into the MessageBundle object's properties For example, "dayAndTemp.msg"
Returns:
String the resultant message For example, "Today is Wednesday, and the temperature is 78 degrees."

getString

public java.lang.String getString(java.lang.String key)
Retrieves a static text segment using a key into the message bundle's properties table.
Parameters:
key - the key into the MessageBundle object's properties For example, "hello.txt"
Returns:
String the static text segment For example, "Hello."

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved