com.mockrunner.mock.web
Class MockJspWriter

java.lang.Object
  extended by java.io.Writer
      extended by javax.servlet.jsp.JspWriter
          extended by com.mockrunner.mock.web.MockJspWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class MockJspWriter
extends javax.servlet.jsp.JspWriter

Mock implementation of JspWriter. Collects the output data.


Field Summary
 
Fields inherited from class javax.servlet.jsp.JspWriter
autoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
MockJspWriter()
           
MockJspWriter(javax.servlet.http.HttpServletResponse response)
           
MockJspWriter(java.io.Writer writer)
           
 
Method Summary
 void clear()
          Clears the output.
 void clearBuffer()
          Clears the output.
 void close()
           
 void flush()
           
 java.lang.String getOutputAsString()
          Returns the output.
 int getRemaining()
           
 void newLine()
           
 void print(boolean value)
           
 void print(char value)
           
 void print(char[] value)
           
 void print(double value)
           
 void print(float value)
           
 void print(int value)
           
 void print(long value)
           
 void print(java.lang.Object value)
           
 void print(java.lang.String value)
           
 void println()
           
 void println(boolean value)
           
 void println(char value)
           
 void println(char[] value)
           
 void println(double value)
           
 void println(float value)
           
 void println(int value)
           
 void println(long value)
           
 void println(java.lang.Object value)
           
 void println(java.lang.String value)
           
 java.lang.String toString()
          Delegates to getOutputAsString()
 void write(char[] cbuf, int off, int len)
           
 
Methods inherited from class javax.servlet.jsp.JspWriter
getBufferSize, isAutoFlush
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MockJspWriter

public MockJspWriter()

MockJspWriter

public MockJspWriter(javax.servlet.http.HttpServletResponse response)
              throws java.io.IOException
Throws:
java.io.IOException

MockJspWriter

public MockJspWriter(java.io.Writer writer)
Method Detail

getOutputAsString

public java.lang.String getOutputAsString()
Returns the output.

Returns:
the output

toString

public java.lang.String toString()
Delegates to getOutputAsString()

Overrides:
toString in class java.lang.Object

clear

public void clear()
           throws java.io.IOException
Clears the output. This method throws an IOException, if a Writer was provided according to spec.

Specified by:
clear in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

clearBuffer

public void clearBuffer()
                 throws java.io.IOException
Clears the output. This method does nothing, if a Writer was provided according to spec.

Specified by:
clearBuffer in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

getRemaining

public int getRemaining()
Specified by:
getRemaining in class javax.servlet.jsp.JspWriter

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

newLine

public void newLine()
             throws java.io.IOException
Specified by:
newLine in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(boolean value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(char value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(char[] value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(double value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(float value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(int value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(long value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(java.lang.Object value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

print

public void print(java.lang.String value)
           throws java.io.IOException
Specified by:
print in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println()
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(boolean value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(char value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(char[] value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(double value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(float value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(int value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(long value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(java.lang.Object value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

println

public void println(java.lang.String value)
             throws java.io.IOException
Specified by:
println in class javax.servlet.jsp.JspWriter
Throws:
java.io.IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException
Specified by:
write in class java.io.Writer
Throws:
java.io.IOException