org.springframework.mock.web
Class MockJspWriter

java.lang.Object
  extended by JspWriter
      extended by org.springframework.mock.web.MockJspWriter

public class MockJspWriter
extends JspWriter

Mock implementation of the javax.servlet.jsp.JspWriter class.

Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.

Since:
2.5
Author:
Juergen Hoeller

Field Summary
private  HttpServletResponse response
           
private  java.io.PrintWriter targetWriter
           
 
Constructor Summary
MockJspWriter(HttpServletResponse response)
          Create a MockJspWriter for the given response, using the response's default Writer.
MockJspWriter(HttpServletResponse response, java.io.Writer targetWriter)
          Create a MockJspWriter for the given response.
 
Method Summary
 void clear()
           
 void clearBuffer()
           
 void close()
           
 void flush()
           
 int getRemaining()
           
protected  java.io.PrintWriter getTargetWriter()
          Lazily initialize the target Writer.
 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)
           
 void write(char[] value, int offset, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

response

private final HttpServletResponse response

targetWriter

private java.io.PrintWriter targetWriter
Constructor Detail

MockJspWriter

public MockJspWriter(HttpServletResponse response)
Create a MockJspWriter for the given response, using the response's default Writer.

Parameters:
response - the servlet response to wrap

MockJspWriter

public MockJspWriter(HttpServletResponse response,
                     java.io.Writer targetWriter)
Create a MockJspWriter for the given response.

Parameters:
response - the servlet response to wrap
targetWriter - the target Writer to wrap
Method Detail

getTargetWriter

protected java.io.PrintWriter getTargetWriter()
                                       throws java.io.IOException
Lazily initialize the target Writer.

Throws:
java.io.IOException

clear

public void clear()
           throws java.io.IOException
Throws:
java.io.IOException

clearBuffer

public void clearBuffer()
                 throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

getRemaining

public int getRemaining()

newLine

public void newLine()
             throws java.io.IOException
Throws:
java.io.IOException

write

public void write(char[] value,
                  int offset,
                  int length)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(boolean value)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(char value)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(char[] value)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(double value)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(float value)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(int value)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(long value)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(java.lang.Object value)
           throws java.io.IOException
Throws:
java.io.IOException

print

public void print(java.lang.String value)
           throws java.io.IOException
Throws:
java.io.IOException

println

public void println()
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(boolean value)
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(char value)
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(char[] value)
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(double value)
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(float value)
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(int value)
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(long value)
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(java.lang.Object value)
             throws java.io.IOException
Throws:
java.io.IOException

println

public void println(java.lang.String value)
             throws java.io.IOException
Throws:
java.io.IOException