Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java HTML Builder (anti-template) library? [closed]

I'm always looking for a modern Java library that makes creating valid (X)HTML snippets easy.

Yes you could use a templating language but there are times when you do not want to do this because Java has some advantages over insert your favorite templating language.

I have seen lots of in-house HTML builders in many projects but there is no Commons-HTML Builder that I can find.

Does anyone know of one?

It would be ideal if it took advantage of the Java 5/6/7 type system (generics) and support Fluent Style. Or something like fluent style ie JQuery style chaining, or a state machine used in mocking libraries like JMock (pedantically speaking a Monad).

A rough builder example might be:

new Html().title("stuff").body().in().div().in().h1("Hello World").hr(); 

Another example: http://codemonkeyism.com/the-best-markup-builder-i-could-build-in-java/

I ended up writing my own: Java Anti-template Language (JATL)

like image 455
Adam Gent Avatar asked Aug 27 '10 11:08

Adam Gent


1 Answers

I ended up writing my own library called Java Anti-template Language (JATL)

like image 183
Adam Gent Avatar answered Sep 23 '22 15:09

Adam Gent