FileDocCategorySizeDatePackage
MessagesSupport.javaAPI DocphoneME MR2 API (J2ME)2048Wed May 02 18:00:34 BST 2007com.sun.perseus.platform

MessagesSupport

public class MessagesSupport extends Object
This class is used to provide support for formating messages.
version
$Id: MessagesSupport.java,v 1.4 2006/04/21 06:33:46 st125089 Exp $

Fields Summary
Constructors Summary
public MessagesSupport(String s)

param
s the name of resource where messages are stored.

    
Methods Summary
public java.lang.StringformatMessage(java.lang.String key, java.lang.Object[] args)

param
key the message key in the bundle resource
param
args the arguments used to format the message.
return
the message formatted with the input arguments

        String msg = key;
        if (args != null) {
            msg += "(";
            for (int i = 0; i < args.length; i++) {
                msg += "[" + i + "] " + args[i];
                if (i < args.length - 1) {
                    msg += ", ";
                }
            }
            msg += ")";
        }
        return msg;