public class Resources extends Object
{@<property>} syntax.
The referenced property must either be located in the same file (the order of the properties in the file is not important) or must already be loaded.
Example:
actions.openDocument.chooseFileDialog.title = {@actions.openDocument.title} actions.openDocument.menu.title = _{@actions.openDocument.title}... actions.openDocument.title = Open document
| Modifier and Type | Method and Description |
|---|---|
static void |
clearResources()
Clears the resources for the default locale.
|
static void |
clearResources(Locale locale)
Clears the resources for the given locale.
|
static String |
getQuantityString(Locale locale,
String key,
int quantity,
Object... args)
Returns the string resource with the given key for the given locale.
|
static String |
getQuantityString(String key,
int quantity,
Object... args)
Returns the string resource with the given key for the default locale.
|
static String |
getString(Locale locale,
String key,
Object... args)
Returns the string resource with the given key for the given locale.
|
static String |
getString(String key,
Object... args)
Returns the string resource with the given key for the default locale.
|
static void |
loadResources(String baseName)
Loads resources from the given resource bundle.
|
static void |
loadResources(String baseName,
Locale locale)
Loads resources from the given resource bundle.
|
static void |
loadResources(String baseName,
Locale locale,
ClassLoader classLoader)
Loads resources from the given resource bundle.
|
public static void clearResources()
public static void clearResources(Locale locale)
IllegalArgumentException - if locale is nullpublic static String getQuantityString(String key, int quantity, Object... args)
MessageFormat.format(String, Object...) into the resource.IllegalArgumentException - if key is null or emptypublic static String getQuantityString(Locale locale, String key, int quantity, Object... args)
MessageFormat.format(String, Object...) into the resource.IllegalArgumentException - if locale is nullIllegalArgumentException - if key is null or emptypublic static String getString(Locale locale, String key, Object... args)
MessageFormat.format(String, Object...) into the resource.IllegalArgumentException - if locale is nullIllegalArgumentException - if key is null or emptypublic static String getString(String key, Object... args)
MessageFormat.format(String, Object...) into the resource.IllegalArgumentException - if key is null or emptypublic static void loadResources(String baseName)
IllegalArgumentException - if baseName is null or emptyResourceBundle.getBundle(String)public static void loadResources(String baseName, Locale locale)
IllegalArgumentException - if baseName is null or emptyIllegalArgumentException - if locale is nullResourceBundle.getBundle(String, Locale)public static void loadResources(String baseName, Locale locale, ClassLoader classLoader)
IllegalArgumentException - if baseName is null or emptyIllegalArgumentException - if locale is nullIllegalArgumentException - if classLoader is nullResourceBundle.getBundle(String, Locale, ClassLoader)