org.apache.tapestry.html
Class HTMLWriter
java.lang.Object
|
+--org.apache.tapestry.AbstractMarkupWriter
|
+--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,v 1.4 2003/06/29 18:05:41 mindbridge Exp $
- Author:
- Howard Lewis Ship
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 |
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)
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
.
- Overrides:
getNestedWriter
in class AbstractMarkupWriter