|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WLocalizedStrings
eu.webtoolkit.jwt.WCombinedLocalizedStrings
public class WCombinedLocalizedStrings
A localized string resolver that bundles multiple string resolvers.
This class implements the localized strings interface and delegates
WString#tr() string resolution to one or more
string resolvers. You will typically use this class if you want to combine
different methods of string resolution (e.g. some from files, and other
strings using a database).
WApplication.setLocalizedStrings(WLocalizedStrings translator)| Constructor Summary | |
|---|---|
WCombinedLocalizedStrings()
Constructor. |
|
| Method Summary | |
|---|---|
void |
add(WLocalizedStrings resolver)
Adds a string resolver. |
java.util.List<WLocalizedStrings> |
getItems()
Returns the list of resolvers. |
void |
hibernate()
Purges memory resources, if possible. |
void |
insert(int index,
WLocalizedStrings resolver)
|
void |
refresh()
Rereads the message resources. |
void |
remove(WLocalizedStrings resolver)
Removes a string resolver. |
java.lang.String |
resolveKey(java.lang.String key)
Resolves a key in the current locale. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WCombinedLocalizedStrings()
| Method Detail |
|---|
public void add(WLocalizedStrings resolver)
The order in which string resolvers are added is significant:
resolveKey()
will consult each string resolver in the order they have been added,
until a match is found.
public void insert(int index,
WLocalizedStrings resolver)
public void remove(WLocalizedStrings resolver)
add(WLocalizedStrings resolver)public java.util.List<WLocalizedStrings> getItems()
add(WLocalizedStrings resolver),
remove(WLocalizedStrings resolver)public void refresh()
WLocalizedStringsPurge any cached key/values, if applicable.
The default implementation does nothing.
refresh in class WLocalizedStringspublic void hibernate()
WLocalizedStringsThis is called afer event handling, and is an opportunity to conserve memory inbetween events, by freeing memory used for cached key/value bindings, if applicable.
The default implementation does nothing.
hibernate in class WLocalizedStringspublic java.lang.String resolveKey(java.lang.String key)
WLocalizedStrings
This method is used by WString to obtain the UTF8 value
corresponding to a key in the current locale.
Returns the value if the key could be resolved. Returns null
otherwise.
resolveKey in class WLocalizedStringsWApplication.getLocale(),
WString.tr(String key)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||