org.apache.tapestry.wml
Class WMLWriter

java.lang.Object
  extended by org.apache.tapestry.AbstractMarkupWriter
      extended by org.apache.tapestry.wml.WMLWriter
All Implemented Interfaces:
IMarkupWriter
Direct Known Subclasses:
NestedWMLWriter

public class WMLWriter
extends AbstractMarkupWriter

This class is used to create WML output.

The WMLResponseWriter handles the necessary escaping of invalid characters. Specifically, the '$', '<', '>' and '&' characters are properly converted to their WML 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.

This class makes it easy to generate trivial and non-trivial WML pages. It is also useful to generate WML snippets. It's ability to do simple formatting is very useful. A JSP may create an instance of the class and use it as an alternative to the simple-minded <%= ... %> construct, espcially because it can handle null more cleanly.

Since:
0.2.9
Version:
$Id: WMLWriter.java 243791 2004-02-19 17:38:13Z hlship $
Author:
David Solis

Constructor Summary
  WMLWriter(OutputStream stream)
          Creates a response writer for content type "text/vnd.wap.wml".
  WMLWriter(OutputStream stream, String encoding)
           
protected WMLWriter(String contentType)
           
  WMLWriter(String contentType, OutputStream stream)
           
  WMLWriter(String mimeType, String encoding, OutputStream stream)
           
 
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

WMLWriter

public WMLWriter(OutputStream stream)
Creates a response writer for content type "text/vnd.wap.wml".


WMLWriter

public WMLWriter(OutputStream stream,
                 String encoding)
Parameters:
stream - the output stream where to write the text
encoding - the encoding to be used to generate the output
Since:
3.0

WMLWriter

public WMLWriter(String contentType,
                 OutputStream stream)

WMLWriter

public WMLWriter(String mimeType,
                 String encoding,
                 OutputStream stream)
Parameters:
mimeType - the MIME type to be used to generate the content type
encoding - the encoding to be used to generate the output
stream - the output stream where to write the text
Since:
3.0

WMLWriter

protected WMLWriter(String contentType)
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