public class MockBodyContent extends BodyContent
BodyContent class.
Only necessary for testing applications when testing custom JSP tags.autoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER| Constructor and Description |
|---|
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.
|
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) |
clearBody, flush, getEnclosingWritergetBufferSize, isAutoFlushpublic MockBodyContent(java.lang.String content,
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,
@Nullable
HttpServletResponse response,
@Nullable
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 BodyContentpublic java.lang.String getString()
getString in class BodyContentpublic void writeOut(java.io.Writer writer)
throws java.io.IOException
writeOut in class BodyContentjava.io.IOExceptionpublic void clear()
throws java.io.IOException
public void clearBuffer()
throws java.io.IOException
clearBuffer in class JspWriterjava.io.IOExceptionpublic void close()
throws java.io.IOException
public int getRemaining()
getRemaining in class JspWriterpublic void newLine()
throws java.io.IOException
public 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
public void print(char value)
throws java.io.IOException
public void print(char[] value)
throws java.io.IOException
public void print(double value)
throws java.io.IOException
public void print(float value)
throws java.io.IOException
public void print(int value)
throws java.io.IOException
public void print(long value)
throws java.io.IOException
public void print(java.lang.Object value)
throws java.io.IOException
public void print(java.lang.String value)
throws java.io.IOException
public void println()
throws java.io.IOException
public void println(boolean value)
throws java.io.IOException
public void println(char value)
throws java.io.IOException
public void println(char[] value)
throws java.io.IOException
public void println(double value)
throws java.io.IOException
public void println(float value)
throws java.io.IOException
public void println(int value)
throws java.io.IOException
public void println(long value)
throws java.io.IOException
public void println(java.lang.Object value)
throws java.io.IOException