juneau-bean-html5
The Juneau HTML5 DTO beans are simply beans with fluent-style setters that allow you to quickly construct HTML fragments as Java objects. These object can then be serialized to HTML using one of the existing HTML serializers, or to other languages such as JSON using the JSON serializers. The HtmlBuilder class is a utility class with predefined static methods that allow you to easily construct DTO bean instances in a minimal amount of code. The following examples show how to create common HTML DOM objects.
Java code | HTML |
---|---|
|
|
|
|
|
|
Using the HTML5 DTO beans, you should be able to construct any valid HTML5 from full document bodies to any possible fragments.
The HtmlParser class can be used convert these HTML documents back into POJOs.
Other serializers and parsers (e.g. JsonSerializer) can be used to represent these POJOs in languages other than HTML.