FileDocCategorySizeDatePackage
Resources.javaAPI DocGlassfish v2 API5176Sat May 05 19:17:50 BST 2007org.apache.taglibs.standard.resources

Resources

public class Resources extends Object

Provides locale-neutral access to string resources. Only the documentation and code are in English. :-)

The major goal, aside from globalization, is convenience. Access to resources with no parameters is made in the form:

Resources.getMessage(MESSAGE_NAME);

Access to resources with one parameter works like

Resources.getMessage(MESSAGE_NAME, arg1);

... and so on.

author
Shawn Bayern

Fields Summary
private static final String
RESOURCE_LOCATION
The location of our resources.
private static ResourceBundle
rb
Our class-wide ResourceBundle.
Constructors Summary
Methods Summary
public static java.lang.StringgetMessage(java.lang.String name)
Retrieves a message with no arguments.



    //*********************************************************************
    // Public static methods

           
        
	      
	return rb.getString(name);
    
public static java.lang.StringgetMessage(java.lang.String name, java.lang.Object[] a)
Retrieves a message with arbitrarily many arguments.

	String res = rb.getString(name);
	return MessageFormat.format(res, a);
    
public static java.lang.StringgetMessage(java.lang.String name, java.lang.Object a1)
Retrieves a message with one argument.

	return getMessage(name, new Object[] { a1 });
    
public static java.lang.StringgetMessage(java.lang.String name, java.lang.Object a1, java.lang.Object a2)
Retrieves a message with two arguments.

	return getMessage(name, new Object[] { a1, a2 });
    
public static java.lang.StringgetMessage(java.lang.String name, java.lang.Object a1, java.lang.Object a2, java.lang.Object a3)
Retrieves a message with three arguments.

	return getMessage(name, new Object[] { a1, a2, a3 });
    
public static java.lang.StringgetMessage(java.lang.String name, java.lang.Object a1, java.lang.Object a2, java.lang.Object a3, java.lang.Object a4)
Retrieves a message with four arguments.

	return getMessage(name, new Object[] { a1, a2, a3, a4 });
    
public static java.lang.StringgetMessage(java.lang.String name, java.lang.Object a1, java.lang.Object a2, java.lang.Object a3, java.lang.Object a4, java.lang.Object a5)
Retrieves a message with five arguments.

	return getMessage(name, new Object[] { a1, a2, a3, a4, a5 });
    
public static java.lang.StringgetMessage(java.lang.String name, java.lang.Object a1, java.lang.Object a2, java.lang.Object a3, java.lang.Object a4, java.lang.Object a5, java.lang.Object a6)
Retrieves a message with six arguments.

	return getMessage(name, new Object[] { a1, a2, a3, a4, a5, a6 });