FileDocCategorySizeDatePackage
FilterPrintWriter.javaAPI DocApache Axis 1.44196Sat Apr 22 18:57:26 BST 2006org.apache.axis.transport.http

FilterPrintWriter

public class FilterPrintWriter extends PrintWriter
simple wrapper around PrintWriter class. It creates the PrintWriter object on demand, thus allowing to have a ResponseWriter class for structural reasons, while actually creating the writer on demand. This solves the problem of having to have a PrintWriter object available and being forced to set the contentType of the response object after creation.
author
Davanum Srinivas (dims@yahoo.com)

Fields Summary
private PrintWriter
_writer
private HttpServletResponse
_response
private static OutputStream
_sink
Constructors Summary
public FilterPrintWriter(HttpServletResponse aResponse)


       
        super(_sink);
        _response = aResponse;
    
Methods Summary
public booleancheckError()

        return getPrintWriter().checkError();
    
public voidclose()

        getPrintWriter().close();
    
public voidflush()

        getPrintWriter().flush();
    
private java.io.PrintWritergetPrintWriter()

        if (_writer == null) {
            try {
                _writer = _response.getWriter();
            } catch (IOException e) {
                throw new RuntimeException(e.toString());
            }
        }
        return _writer;
    
public voidprint(boolean b)

        getPrintWriter().print(b);
    
public voidprint(char c)

        getPrintWriter().print(c);
    
public voidprint(int i)

        getPrintWriter().print(i);
    
public voidprint(long l)

        getPrintWriter().print(l);
    
public voidprint(float v)

        getPrintWriter().print(v);
    
public voidprint(double v)

        getPrintWriter().print(v);
    
public voidprint(char[] chars)

        getPrintWriter().print(chars);
    
public voidprint(java.lang.String string)

        getPrintWriter().print(string);
    
public voidprint(java.lang.Object object)

        getPrintWriter().print(object);
    
public voidprintln()

        getPrintWriter().println();
    
public voidprintln(boolean b)

        getPrintWriter().println(b);
    
public voidprintln(char c)

        getPrintWriter().println(c);
    
public voidprintln(int i)

        getPrintWriter().println(i);
    
public voidprintln(long l)

        getPrintWriter().println(l);
    
public voidprintln(float v)

        getPrintWriter().println(v);
    
public voidprintln(double v)

        getPrintWriter().println(v);
    
public voidprintln(char[] chars)

        getPrintWriter().println(chars);
    
public voidprintln(java.lang.String string)

        getPrintWriter().println(string);
    
public voidprintln(java.lang.Object object)

        getPrintWriter().println(object);
    
public voidwrite(int i)

        getPrintWriter().write(i);
    
public voidwrite(char[] chars)

        getPrintWriter().write(chars);
    
public voidwrite(char[] chars, int i, int i1)

        getPrintWriter().write(chars, i, i1);
    
public voidwrite(java.lang.String string)

        getPrintWriter().write(string);
    
public voidwrite(java.lang.String string, int i, int i1)

        getPrintWriter().write(string, i, i1);