I need a Java library allowing me to define my own tags / commands and then creating html output based on a given data-model.
In example I’d like the library to handle such a situation:
String template = "<name>key1</name><image>key1</image>"
map.put("key1", imageObject);
String html = parser.parse(template, map);
html == "<i>An Image</i><img src='image.jpg'/>"
So the basic functionality would be to generate html based on the custom tag (e.g. <name>) – each tag would generate different output.
I.e. name would print a string, whereas image would place an image. The imageObject has appropriate fields that the parsing library can reach.
Kind regards,
Queequeg
I think Velocity can be suitable in your case