| The message formatter, which uses map's keys in place of numbers.
This class extends functionality of MessageFormat by allowing the user to
specify strings in place of MessageFormatter's numbers. It then uses given
map to translate keys to values. It also handles conditional expressions.
You will usually use this formatter as follows:
JMapFormat.format("Hello {name}", map);
For conditional expression:
JMapFormat.format("Hello {name,old_suffix,new_suffix,no_match}");
Last three parameters are optional. At first, name is translated. If it then has
suffix old_suffix it is replaced by te new_suffix else whole parrent is replaced by
no_match string.
Notes: if map does not contain value for key specified, it substitutes
the value by "null" word to qualify that something goes wrong.
author: Slavek Psenicka, Martin Ryzl version: 1.0, March 11. 1999 |