Does anyone know of a Java library that provides support for the ${var} style substitution in text files?
+4
A:
Velocity ( http://velocity.apache.org ), FreeMarker ( http://freemarker.sourceforge.net/ )
snw
2010-03-03 21:48:58
+1
A:
Don't pass up StringTemplate it is probably the cleanest separation of data and template concerns and is very robust.
fuzzy lollipop
2010-03-03 22:39:14
+1
A:
Java's MessageFormat class allows for semi-advanced text substitution, with localization and formatting support for numbers, dates and time. And for pluralization, you may even use java.text.ChoiceFormat with MessageFormat. It may be enough for all your text-substitution needs.
If not, you can take a look at Apache Velocity (http://velocity.apache.org/) or Freemarker(http://freemarker.sourceforge.net/)
Olivier Croisier
2010-03-04 00:38:06
Good to know that Sun has their own built-in tool for this. It works well if you don't want to include any other libraries. It is also available in Java 1.4 and 5.
Alex Beardsley
2010-06-22 22:22:36
A:
Santhosh Kumar T
2010-03-05 11:07:03