|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.lessy.util.resource.ResourceManager
public class ResourceManager
Convenient Manager around a resource bundle. This class is a pseudo singleton. You can create more then one instance but only the last created instance can be retrieved with the getInstance-Method.
If you have only one bundle, then call the constructor once and pass the bundlename to it. From there you can always get a reference to the manager with the static getInstance-Method.
The manager can be configured through Spring by just adding it as a bean and configuring the bundlename as a constructor parameter.
| Constructor Summary | |
|---|---|
ResourceManager(String bundleName)
Constructor |
|
| Method Summary | |
|---|---|
MessageBean |
createMessageBean(String key,
Object... insets)
|
String |
getBundleName()
Name of the resource bundle |
static ResourceManager |
getInstance()
Get the one and only singleton instance. |
String |
getString(MessageHolder messageBean)
Gets a string from the resource bundle. |
String |
getString(String key,
Object... insets)
Gets a String by it's key |
void |
setBundleName(String bundleName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceManager(String bundleName)
bundleName - fully qualified resource name, i.e. "net.lessy.res.Resource" (without extension .properties)| Method Detail |
|---|
public static ResourceManager getInstance()
public MessageBean createMessageBean(String key,
Object... insets)
public String getString(String key,
Object... insets)
getString in interface MessageResolverkey - Key of the resource stringinsets - optional insets
public String getString(MessageHolder messageBean)
messageBean -
public String getBundleName()
public void setBundleName(String bundleName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||