public class ResourceManager extends Object
| Modifier and Type | Method and Description |
|---|---|
static ResourceManager |
all(Class clazz) |
static ResourceManager |
common()
Gets the default ResourceManager.
|
static ResourceManager |
get(Class clazz)
Gets the ResourceManager associated with
clazz. |
static ResourceManager |
get(String bundleName)
Gets the ResourceManager with the given name.
|
char |
getChar(String key)
Gets the first character of the String associated with
key. |
String |
getString(String key)
Gets the String associated with
key after having resolved
any nested keys (resolve(String)). |
String |
getString(String key,
Object[] args)
Gets the String associated with
key after having resolved
any nested keys (resolve(String)) and applied a formatter using
the given args. |
static String |
resolve(String rbAndProperty)
Resolves any references to a resource bundle contained in
rbAndProperty. |
static String |
resolve(String rbAndProperty,
Object[] args)
Same as
resolve(String) but once the value as been resolved, a
MessageFormatter is applied with the given args. |
static ResourceManager |
ui() |
public static ResourceManager get(Class clazz)
clazz. It looks for
a ResourceBundle named against the class name plus the string "RB". For
example, for the com.mypackage.Main, the ResourceBundle
com.mypackage.MainRB will be looked up.clazz - public static ResourceManager get(String bundleName)
bundleName - public static ResourceManager all(Class clazz)
clazz - public static ResourceManager common()
all(ResourceManager.class). It returns the ResourceManager
named "AllRB" located in the same package ResourceManager class (i.e
com.l2fprod.common.util.AllRB).public static ResourceManager ui()
public static String resolve(String rbAndProperty)
rbAndProperty. To reference a resource bundle inside a
property use ${com.package.FileRB:key}, this will look for
key in the ResourceBundle com.package.FileRB.rbAndProperty - public static String resolve(String rbAndProperty, Object[] args)
resolve(String) but once the value as been resolved, a
MessageFormatter is applied with the given args.rbAndProperty - args - public String getString(String key)
key after having resolved
any nested keys (resolve(String)).key - the key to lookupkeypublic String getString(String key, Object[] args)
key after having resolved
any nested keys (resolve(String)) and applied a formatter using
the given args.key - the key to lookupargs - the arguments to pass to the formatterkeypublic char getChar(String key)
key.key - the key to lookupkey.Copyright © 2015. All rights reserved.