org.riotfamily.common.markup
Class DocumentWriter
java.lang.Object
org.riotfamily.common.markup.DocumentWriter
public class DocumentWriter
- extends Object
Utility class to generate markup code. This example ...
DocumentWriter doc = new DocumentWriter(writer);
doc.start("body");
doc.start("p").attribute("class", "foo");
doc.body("Hello ");
doc.start("strong").body("World");
doc.closeAll();
... will produce the following code:
<body><p class="foo">Hello <strong>World</strong></p></body>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentWriter
public DocumentWriter(PrintWriter writer)
DocumentWriter
public DocumentWriter(PrintWriter writer,
boolean xhtml)
start
public DocumentWriter start(String tagName)
startEmpty
public DocumentWriter startEmpty(String tagName)
start
public DocumentWriter start(String tagName,
boolean empty)
attribute
public DocumentWriter attribute(String name)
attribute
public DocumentWriter attribute(String name,
int value)
attribute
public DocumentWriter attribute(String name,
boolean present)
attribute
public DocumentWriter attribute(String name,
String value)
attribute
public DocumentWriter attribute(String name,
String value,
boolean renderEmpty)
body
public DocumentWriter body()
body
public DocumentWriter body(String body)
body
public DocumentWriter body(String body,
boolean escapeHtml)
println
public DocumentWriter println(String s)
end
public DocumentWriter end()
closeAll
public void closeAll()