org.crosswire.common.util
Class MsgBase

java.lang.Object
  extended by org.crosswire.common.util.MsgBase
Direct Known Subclasses:
BDMsg, CWMsg, CWOtherMsg, GPLMsg, JSMsg, JSOtherMsg, LGPLMsg, Msg

public class MsgBase
extends Object

A base class for implementing type safe internationalization (i18n) that is easy for most cases. See org.crosswire.common.util.Msg for an example of how to inherit from here.

Author:
Joe Walker [joe at eireneh dot com], DM Smith [dmsmith555 at yahoo dot com]
See Also:
for license details.
The copyright to this program is held by it's authors.

Field Summary
private static Logger log
          The log stream
private static Map<String,ResourceBundle> resourceMap
          Resource map maintains a mapping of class names to resources found by that name.
private  ResourceBundle resources
          If there is any internationalization to be done, it is thru this
private  NumberShaper shaper
          Internationalize numbers
 
Constructor Summary
protected MsgBase()
          Create a MsgBase object
 
Method Summary
protected  void loadResources()
          Initialize any resource bundles
 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

resourceMap

private static Map<String,ResourceBundle> resourceMap
Resource map maintains a mapping of class names to resources found by that name.


resources

private ResourceBundle resources
If there is any internationalization to be done, it is thru this


shaper

private NumberShaper shaper
Internationalize numbers


log

private static final Logger log
The log stream

Constructor Detail

MsgBase

protected MsgBase()
Create a MsgBase object

Method Detail

lookup

public String lookup(String key,
                     Object... params)
Get the internationalized text, but return key if key is unknown.

Parameters:
key -
Returns:
the internationalized text

loadResources

protected final void loadResources()
Initialize any resource bundles


obtainString

private String obtainString(String key)

Copyright ? 2003-2011