public class MockBodyContent
extends javax.servlet.jsp.tagext.BodyContent
BodyContent class.
Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.
| Constructor and Description |
|---|
MockBodyContent(java.lang.String content,
javax.servlet.http.HttpServletResponse response)
Create a MockBodyContent for the given response.
|
MockBodyContent(java.lang.String content,
javax.servlet.http.HttpServletResponse response,
java.io.Writer targetWriter)
Create a MockBodyContent for the given response.
|
MockBodyContent(java.lang.String content,
java.io.Writer targetWriter)
Create a MockBodyContent for the given response.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
clearBuffer() |
void |
close() |
java.io.Reader |
getReader() |
int |
getRemaining() |
java.lang.String |
getString() |
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) |
void |
writeOut(java.io.Writer writer) |
public MockBodyContent(java.lang.String content,
javax.servlet.http.HttpServletResponse response)
content - the body content to exposeresponse - the servlet response to wrappublic MockBodyContent(java.lang.String content,
java.io.Writer targetWriter)
content - the body content to exposetargetWriter - the target Writer to wrappublic MockBodyContent(java.lang.String content,
javax.servlet.http.HttpServletResponse response,
java.io.Writer targetWriter)
content - the body content to exposeresponse - the servlet response to wraptargetWriter - the target Writer to wrappublic java.io.Reader getReader()
getReader in class javax.servlet.jsp.tagext.BodyContentpublic java.lang.String getString()
getString in class javax.servlet.jsp.tagext.BodyContentpublic void writeOut(java.io.Writer writer)
throws java.io.IOException
writeOut in class javax.servlet.jsp.tagext.BodyContentjava.io.IOExceptionpublic void clear()
throws java.io.IOException
clear in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void clearBuffer()
throws java.io.IOException
clearBuffer in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic int getRemaining()
getRemaining in class javax.servlet.jsp.JspWriterpublic void newLine()
throws java.io.IOException
newLine in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void write(char[] value,
int offset,
int length)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void print(boolean value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void print(char value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void print(char[] value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void print(double value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void print(float value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void print(int value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void print(long value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void print(java.lang.Object value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void print(java.lang.String value)
throws java.io.IOException
print in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println()
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(boolean value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(char value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(char[] value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(double value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(float value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(int value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(long value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(java.lang.Object value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOExceptionpublic void println(java.lang.String value)
throws java.io.IOException
println in class javax.servlet.jsp.JspWriterjava.io.IOException