|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.common.util.MsgBase
public class MsgBase
A base class for implementing type safe internationalization (i18n) that is easy for most cases.
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
private static Map<Locale,Map<String,ResourceBundle>> |
localeToResourceMap
|
private static org.slf4j.Logger |
log
The log stream |
private NumberShaper |
shaper
Internationalize numbers |
Constructor Summary | |
---|---|
protected |
MsgBase()
Create a MsgBase object |
Method Summary | |
---|---|
private Map<String,ResourceBundle> |
getLazyLocalisedResourceMap(Locale currentUserLocale)
Gets the localised resource map, initialising it if it doesn't already exist |
private ResourceBundle |
getLocalisedResources()
|
private ResourceBundle |
getResourceBundleForClass(Class<? extends MsgBase> implementingClass,
String className,
String shortClassName,
Locale currentUserLocale,
Map<String,ResourceBundle> localisedResourceMap)
Gets the resource bundle for a particular class |
String |
lookup(String key,
Object... params)
Get the internationalized text, but return key if key is unknown. |
private String |
obtainString(String key)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static Map<Locale,Map<String,ResourceBundle>> localeToResourceMap
private NumberShaper shaper
private static final org.slf4j.Logger log
Constructor Detail |
---|
protected MsgBase()
Method Detail |
---|
public String lookup(String key, Object... params)
key
-
private String obtainString(String key)
private ResourceBundle getLocalisedResources()
private ResourceBundle getResourceBundleForClass(Class<? extends MsgBase> implementingClass, String className, String shortClassName, Locale currentUserLocale, Map<String,ResourceBundle> localisedResourceMap)
implementingClass
- the implementing classclassName
- the class nameshortClassName
- the short class namecurrentUserLocale
- the current user localelocalisedResourceMap
- the localised resource map
private Map<String,ResourceBundle> getLazyLocalisedResourceMap(Locale currentUserLocale)
currentUserLocale
- the current user locale
|
Copyright ? 2003-2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |