org.apache.tapestry.html
Class HTMLWriter

java.lang.Object
  extended by org.apache.tapestry.AbstractMarkupWriter
      extended by org.apache.tapestry.html.HTMLWriter
All Implemented Interfaces:
IMarkupWriter
Direct Known Subclasses:
NestedHTMLWriter

public class HTMLWriter
extends AbstractMarkupWriter

This class is used to create HTML output.

The HTMLWriter handles the necessary escaping of invalid characters. Specifically, the '<', '>' and '&' characters are properly converted to their HTML entities by the print() methods. Similar measures are taken by the AbstractMarkupWriter.attribute(String, String) method. Other invalid characters are converted to their numeric entity equivalent.

Version:
$Id: HTMLWriter.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Constructor Summary
  HTMLWriter(OutputStream outputStream)
          Creates a default writer for content type "text/html; charset=utf-8".
  HTMLWriter(OutputStream outputStream, String encoding)
           
  HTMLWriter(PrintWriter writer)
          Creates a new markup writer around the PrintWriter.
protected HTMLWriter(String contentType)
           
  HTMLWriter(String contentType, OutputStream outputStream)
           
  HTMLWriter(String contentType, String encoding, OutputStream outputStream)
           
 
Method Summary
 IMarkupWriter getNestedWriter()
          Returns a nested writer, one that accumulates its changes in a buffer.
 
Methods inherited from class org.apache.tapestry.AbstractMarkupWriter
attribute, attribute, attribute, attributeRaw, begin, beginEmpty, checkError, close, closeTag, comment, end, end, flush, getContentType, pop, print, print, print, print, println, printRaw, printRaw, push, setOutputStream, setWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLWriter

public HTMLWriter(PrintWriter writer)
Creates a new markup writer around the PrintWriter. The writer will not be closed when the markup writer closes. The content type is currently hard-wired to text/html.

Since:
3.0

HTMLWriter

public HTMLWriter(String contentType,
                  OutputStream outputStream)

HTMLWriter

public HTMLWriter(String contentType,
                  String encoding,
                  OutputStream outputStream)

HTMLWriter

protected HTMLWriter(String contentType)

HTMLWriter

public HTMLWriter(OutputStream outputStream)
Creates a default writer for content type "text/html; charset=utf-8".


HTMLWriter

public HTMLWriter(OutputStream outputStream,
                  String encoding)
Method Detail

getNestedWriter

public IMarkupWriter getNestedWriter()
Description copied from interface: IMarkupWriter
Returns a nested writer, one that accumulates its changes in a buffer. When the nested writer is closed, it writes its buffer into its containing IMarkupWriter.

Specified by:
getNestedWriter in interface IMarkupWriter
Specified by:
getNestedWriter in class AbstractMarkupWriter