Provides a HTML element StringBuffer for rendering, automatically escaping string values. HtmlStringBuffer is used by Click controls for HTML rendering.
For example the following code:
public String toString() { HtmlStringBuffer buffer = new HtmlStringBuffer(); buffer.elementStart("input"); buffer.appendAttribute("type", "text"); buffer.appendAttribute("name", getName()); buffer.appendAttribute("value", getValue()); buffer.elementEnd(); return buffer.toString(); }
Would render:
<input type="text" name="address" value="23 Holt's Street"/>
Synchronization
To improve performance in Click's thread safe environment this class does not synchronize append operations. Internally this class uses a character buffer adapted from the JDK 1.5
AbstractStringBuilder.