public class Resources
extends java.lang.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.
| Modifier and Type | Field and Description |
|---|---|
private static java.util.ResourceBundle |
rb
Our class-wide ResourceBundle.
|
| Constructor and Description |
|---|
Resources() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getMessage(java.lang.String name)
Retrieves a message with no arguments.
|
static java.lang.String |
getMessage(java.lang.String name,
java.lang.Object... a)
Retrieves a message with arbitrarily many arguments.
|
public static java.lang.String getMessage(java.lang.String name)
throws java.util.MissingResourceException
name - the name of the messagejava.util.MissingResourceException - if the message does not existpublic static java.lang.String getMessage(java.lang.String name,
java.lang.Object... a)
throws java.util.MissingResourceException
name - the name of the messagea - arguments to be substituted into the message textjava.util.MissingResourceException - if the message does not exist