org.apache.myfaces.test.mock
Class MockPrintWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by org.apache.myfaces.test.mock.MockPrintWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class MockPrintWriter
extends PrintWriter

Mock implementation of PrintWriter.

$Id: MockPrintWriter.java 990408 2010-08-28 18:59:21Z lu4242 $

Since:
1.0.0

Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
MockPrintWriter(CharArrayWriter writer)
          Return a default instance.
 
Method Summary
 char[] content()
          Return the content that has been written to this writer.
 void reset()
          Reset this output stream so that it appears no content has been written.
 int size()
          Return the number of characters that have been written to this writer.
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockPrintWriter

public MockPrintWriter(CharArrayWriter writer)

Return a default instance.

Parameters:
writer - Temporary buffer storage for us to use
Method Detail

content

public char[] content()

Return the content that has been written to this writer.


reset

public void reset()

Reset this output stream so that it appears no content has been written.


size

public int size()

Return the number of characters that have been written to this writer.



Copyright © 2011 The Apache Software Foundation. All Rights Reserved.