Resourcespublic 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. |
Fields Summary |
---|
private static final String | RESOURCE_LOCATIONThe location of our resources. | private static ResourceBundle | rbOur class-wide ResourceBundle. |
Methods Summary |
---|
public static java.lang.String | getMessage(java.lang.String name)Retrieves a message with no arguments.
//*********************************************************************
// Public static methods
return rb.getString(name);
| public static java.lang.String | getMessage(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.String | getMessage(java.lang.String name, java.lang.Object a1)Retrieves a message with one argument.
return getMessage(name, new Object[] { a1 });
| public static java.lang.String | getMessage(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.String | getMessage(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.String | getMessage(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.String | getMessage(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.String | getMessage(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 });
|
|