The StringManager operates on a package basis. One StringManager per package can be created and accessed via the getManager method call.
The StringManager will look for a ResourceBundle named by the package name given plus the suffix of "LocalStrings". In practice, this means that the localized information will be contained in a LocalStrings.properties file located in the package directory of the classpath.
Please see the documentation for java.util.ResourceBundle for more information.
java.util.ResourceBundle
| Modifier and Type | Field and Description |
|---|---|
| private ResourceBundle | bundle
The ResourceBundle for this StringManager. |
| private static final Map |
| Access | Constructor and Description |
|---|---|
| private | StringManager(String
Name of package to create StringManager for. packageName, ClassLoader loader)Creates a new StringManager for a given package. |
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static synchronized StringManager | |
| public static synchronized StringManager | |
| public static synchronized StringManager | getManager(String packageName, Locale loc, ClassLoader loader)
Get the StringManager for a particular package and Locale. |
| public String | |
| public String | |
| public String | |
| public String | |
| public String | |
| public String |
| bundle | back to summary |
|---|---|
| private ResourceBundle bundle The ResourceBundle for this StringManager. | |
| managers | back to summary |
|---|---|
| private static final Map<String, StringManager> managers | |
| StringManager | back to summary |
|---|---|
| private StringManager(String packageName, ClassLoader loader) Creates a new StringManager for a given package. This is a private method and all access to it is arbitrated by the static getManager method call so that only one StringManager per package will be created.
| |
| StringManager | back to summary |
|---|---|
| private StringManager(String packageName, Locale loc, ClassLoader loader) | |
| StringManager | back to summary |
|---|---|
| private StringManager(ResourceBundle bundle) | |
| getManager | back to summary |
|---|---|
| public static synchronized StringManager getManager(String packageName, ClassLoader loader) Get the StringManager for a particular package. If a manager for a package already exists, it will be reused, else a new StringManager will be created and returned. | |
| getManager | back to summary |
|---|---|
| public static synchronized StringManager getManager(ResourceBundle bundle) Get the StringManager for a particular package. If a manager for a package already exists, it will be reused, else a new StringManager will be created and returned. | |
| getManager | back to summary |
|---|---|
| public static synchronized StringManager getManager(String packageName, Locale loc, ClassLoader loader) Get the StringManager for a particular package and Locale. If a manager for a package already exists, it will be reused, else a new StringManager will be created for that Locale and returned. | |
| getString | back to summary |
|---|---|
| public String getString(String key) Get a string from the underlying resource bundle or return null if the String is not found.
| |
| getString | back to summary |
|---|---|
| public String getString(String key, Object[] args) Get a string from the underlying resource bundle and format it with the given set of arguments. | |
| getString | back to summary |
|---|---|
| public String getString(String key, Object arg) Get a string from the underlying resource bundle and format it with the given object argument. This argument can of course be a String object. | |
| getString | back to summary |
|---|---|
| public String getString(String key, Object arg1, Object arg2) Get a string from the underlying resource bundle and format it with the given object arguments. These arguments can of course be String objects. | |
| getString | back to summary |
|---|---|
| public String getString(String key, Object arg1, Object arg2, Object arg3) Get a string from the underlying resource bundle and format it with the given object arguments. These arguments can of course be String objects. | |
| getString | back to summary |
|---|---|
| public String getString(String key, Object arg1, Object arg2, Object arg3, Object arg4) Get a string from the underlying resource bundle and format it with the given object arguments. These arguments can of course be String objects. | |