Package com.googlecode.jatl
For quickstart documentation: http://jatl.googlecode.com/ and
MarkupBuilder.
Example
StringWriter sw = new StringWriter();
new Html(sw) {{
div().title("first");
span().id("hello").end();
div().title("second");
text("Second");
start("custom1").attr("data", "value").end();
start("custom2").text("hello").end();
end();
end();
}};
String result = sw.getBuffer().toString();
String expected = "\n" +
"<div title=\"first\">\n" +
" <span id=\"hello\"/>\n" +
" <div title=\"second\">Second\n" +
" <custom1 data=\"value\"/>\n" +
" <custom2>hello\n" +
" </custom2>\n" +
" </div>\n" +
"</div>";
assertEquals(expected, result);
See MarkupBuilder for creating your own markup builders.
-
Interface Summary Interface Description Indenter A strategy to indent or in other words pretty print the markup.MarkupBuilderWriter The methods in this class will be merged withMarkupWriterin 0.3.0.MarkupWriter Wrap builders for deferred writing. -
Class Summary Class Description GeneratedHtmlBuilder<T> Auto-Generated builder from schema: xhtml1-transitional.xsdHtml Most of the XHTML tags and attributes are available as methods.HtmlBuilder<T> Most of the XHTML tags and attributes are available as methods.HtmlWriter Writes HTML using anHtmlBuilderby callingHtmlWriter.write(Writer).MarkupBuilder<T> Fluent styled markup builder that writes to aWriter.MarkupBuilder.Tag MarkupUtils XML Utils.SimpleIndenter A simple indenter that takes a String for before and after on the opening and closing tag. -
Enum Summary Enum Description Indenter.TagIndentSpot Indicates the current position (cursor) of where whitespace is to be applied.MarkupBuilder.TagClosingPolicy Policy for how tags should be closed.