org.springframework.mock.web
Class MockBodyContent
java.lang.Object
BodyContent
org.springframework.mock.web.MockBodyContent
public class MockBodyContent
- extends BodyContent
Mock implementation of the javax.servlet.jsp.tagext.BodyContent
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 java.lang.String |
content
|
Constructor Summary |
MockBodyContent(java.lang.String content,
HttpServletResponse response)
Create a MockBodyContent for the given response. |
MockBodyContent(java.lang.String content,
HttpServletResponse response,
java.io.Writer targetWriter)
Create a MockBodyContent for the given response. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
content
private final java.lang.String content
MockBodyContent
public MockBodyContent(java.lang.String content,
HttpServletResponse response)
- Create a MockBodyContent for the given response.
- Parameters:
content
- the body content to exposeresponse
- the servlet response to wrap
MockBodyContent
public MockBodyContent(java.lang.String content,
HttpServletResponse response,
java.io.Writer targetWriter)
- Create a MockBodyContent for the given response.
- Parameters:
content
- the body content to exposeresponse
- the servlet response to wraptargetWriter
- the target Writer to wrap
adaptJspWriter
private static JspWriter adaptJspWriter(java.io.Writer targetWriter,
HttpServletResponse response)
getReader
public java.io.Reader getReader()
getString
public java.lang.String getString()
writeOut
public void writeOut(java.io.Writer writer)
throws java.io.IOException
- 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
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