FileDocCategorySizeDatePackage
Messages.javaAPI DocAndroid 1.5 API5116Wed May 06 22:41:04 BST 2009org.apache.harmony.luni.internal.nls

Messages

public class Messages extends Object
This class retrieves strings from a resource bundle and returns them, formatting them with MessageFormat when required.

It is used by the system classes to provide national language support, by looking up messages in the org.apache.harmony.luni.internal.nls.messages resource bundle. Note that if this file is not available, or an invalid key is looked up, or resource bundle support is not available, the key itself will be returned as the associated message. This means that the KEY should a reasonable human-readable (english) string.

Fields Summary
private static final String
sResource
Constructors Summary
Methods Summary
public static java.lang.StringgetString(java.lang.String msg)
Retrieves a message which has no arguments.

param
msg String the key to look up.
return
String the message for that key in the system message bundle.

 //$NON-NLS-1$
    // END android-changed

                                                
         
        // BEGIN android-changed
        return MsgHelp.getString(sResource, msg);
        // END android-changed
    
public static java.lang.StringgetString(java.lang.String msg, java.lang.Object arg)
Retrieves a message which takes 1 argument.

param
msg String the key to look up.
param
arg Object the object to insert in the formatted output.
return
String the message for that key in the system message bundle.

        return getString(msg, new Object[] { arg });
    
public static java.lang.StringgetString(java.lang.String msg, int arg)
Retrieves a message which takes 1 integer argument.

param
msg String the key to look up.
param
arg int the integer to insert in the formatted output.
return
String the message for that key in the system message bundle.

        return getString(msg, new Object[] { Integer.toString(arg) });
    
public static java.lang.StringgetString(java.lang.String msg, char arg)
Retrieves a message which takes 1 character argument.

param
msg String the key to look up.
param
arg char the character to insert in the formatted output.
return
String the message for that key in the system message bundle.

        return getString(msg, new Object[] { String.valueOf(arg) });
    
public static java.lang.StringgetString(java.lang.String msg, java.lang.Object arg1, java.lang.Object arg2)
Retrieves a message which takes 2 arguments.

param
msg String the key to look up.
param
arg1 Object an object to insert in the formatted output.
param
arg2 Object another object to insert in the formatted output.
return
String the message for that key in the system message bundle.

        return getString(msg, new Object[] { arg1, arg2 });
    
public static java.lang.StringgetString(java.lang.String msg, java.lang.Object[] args)
Retrieves a message which takes several arguments.

param
msg String the key to look up.
param
args Object[] the objects to insert in the formatted output.
return
String the message for that key in the system message bundle.

        // BEGIN android-changed
        return MsgHelp.getString(sResource, msg, args);
        // END android-changed