|
||||||||||
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. See Msg
for an
example of how to inherit from here.
Some Regex/Vi macros to convert from a half way house i18n scheme where the strings are in Msg classes but not properties files: The following makes the lookup string simple :%s/Msg \([^ ]*\) = new Msg(".*")/Msg \1 = new Msg("\1")/ These turn a lookup string into a properties file :%s/ static final Msg // :%s/ = new Msg("/: / :%s/");\/\/\$NON-NLS-1\$$/
for license details.
The copyright to this program is held by it's authors.
,
Msg
Field Summary | |
---|---|
private static Logger |
log
The log stream |
private String |
name
|
private static Map |
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 |
Constructor Summary | |
---|---|
protected |
MsgBase(String name)
Create a MsgBase object |
Method Summary | |
---|---|
protected void |
loadResources()
Initialise any resource bundles |
String |
toString()
|
String |
toString(Object param)
Formats the message with the given parameter. |
String |
toString(Object[] params)
Formats the message with the given parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String name
private static Map resourceMap
private ResourceBundle resources
private static final Logger log
Constructor Detail |
---|
protected MsgBase(String name)
Method Detail |
---|
public String toString()
toString
in class Object
public String toString(Object param)
public String toString(Object[] params)
protected final void loadResources()
|
Copyright ยจ 2003-2006 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |