public class MockJspWriter
extends javax.servlet.jsp.JspWriter
JspWriter class.
Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.
| Constructor and Description |
|---|
MockJspWriter(javax.servlet.http.HttpServletResponse response)
Create a MockJspWriter for the given response,
using the response's default Writer.
|
MockJspWriter(javax.servlet.http.HttpServletResponse response,
java.io.Writer targetWriter)
Create a MockJspWriter for the given response.
|
MockJspWriter(java.io.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 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) |
public MockJspWriter(javax.servlet.http.HttpServletResponse response)
response - the servlet response to wrappublic MockJspWriter(java.io.Writer targetWriter)
targetWriter - the target Writer to wrappublic MockJspWriter(javax.servlet.http.HttpServletResponse response,
java.io.Writer targetWriter)
response - the servlet response to wraptargetWriter - the target Writer to wrapprotected java.io.PrintWriter getTargetWriter()
throws java.io.IOException
java.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 flush()
throws java.io.IOException
flush in interface java.io.Flushableflush 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