public class MockJspWriter extends JspWriter
JspWriter class.
Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.
autoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER| Constructor and Description |
|---|
MockJspWriter(HttpServletResponse response)
Create a MockJspWriter for the given response,
using the response's default Writer.
|
MockJspWriter(HttpServletResponse response,
Writer targetWriter)
Create a MockJspWriter for the given response.
|
MockJspWriter(Writer targetWriter)
Create a MockJspWriter for the given plain Writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
clearBuffer() |
void |
close() |
void |
flush() |
int |
getRemaining() |
protected 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(Object value) |
void |
print(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(Object value) |
void |
println(String value) |
void |
write(char[] value,
int offset,
int length) |
getBufferSize, isAutoFlushpublic MockJspWriter(HttpServletResponse response)
response - the servlet response to wrappublic MockJspWriter(Writer targetWriter)
targetWriter - the target Writer to wrappublic MockJspWriter(HttpServletResponse response, Writer targetWriter)
response - the servlet response to wraptargetWriter - the target Writer to wrapprotected PrintWriter getTargetWriter() throws IOException
IOExceptionpublic void clear()
throws IOException
clear in class JspWriterIOExceptionpublic void clearBuffer()
throws IOException
clearBuffer in class JspWriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class JspWriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class JspWriterIOExceptionpublic int getRemaining()
getRemaining in class JspWriterpublic void newLine()
throws IOException
newLine in class JspWriterIOExceptionpublic void write(char[] value,
int offset,
int length)
throws IOException
write in class WriterIOExceptionpublic void print(boolean value)
throws IOException
print in class JspWriterIOExceptionpublic void print(char value)
throws IOException
print in class JspWriterIOExceptionpublic void print(char[] value)
throws IOException
print in class JspWriterIOExceptionpublic void print(double value)
throws IOException
print in class JspWriterIOExceptionpublic void print(float value)
throws IOException
print in class JspWriterIOExceptionpublic void print(int value)
throws IOException
print in class JspWriterIOExceptionpublic void print(long value)
throws IOException
print in class JspWriterIOExceptionpublic void print(Object value) throws IOException
print in class JspWriterIOExceptionpublic void print(String value) throws IOException
print in class JspWriterIOExceptionpublic void println()
throws IOException
println in class JspWriterIOExceptionpublic void println(boolean value)
throws IOException
println in class JspWriterIOExceptionpublic void println(char value)
throws IOException
println in class JspWriterIOExceptionpublic void println(char[] value)
throws IOException
println in class JspWriterIOExceptionpublic void println(double value)
throws IOException
println in class JspWriterIOExceptionpublic void println(float value)
throws IOException
println in class JspWriterIOExceptionpublic void println(int value)
throws IOException
println in class JspWriterIOExceptionpublic void println(long value)
throws IOException
println in class JspWriterIOExceptionpublic void println(Object value) throws IOException
println in class JspWriterIOExceptionpublic void println(String value) throws IOException
println in class JspWriterIOException