org.apache.shale.test.mock
Class MockPrintWriter

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

public class MockPrintWriter
extends PrintWriter

Mock implementation of PrintWriter.

$Id: MockPrintWriter.java 464373 2006-10-16 04:21:54Z rahul $


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, 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 © 2004-2007 Apache Software Foundation. All Rights Reserved.