public class MockJspWriter
extends JspWriter
javax.servlet.jsp.JspWriter
class.
Only necessary for testing applications when testing custom JSP tags.Modifier and Type | Field and Description |
---|---|
private HttpServletResponse |
response |
private java.io.PrintWriter |
targetWriter |
Constructor and Description |
---|
MockJspWriter(HttpServletResponse response)
Create a MockJspWriter for the given response,
using the response's default Writer.
|
MockJspWriter(HttpServletResponse response,
java.io.Writer targetWriter)
Create a MockJspWriter for the given response.
|
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) |
private final HttpServletResponse response
private java.io.PrintWriter targetWriter
public MockJspWriter(HttpServletResponse response)
response
- the servlet response to wrappublic MockJspWriter(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.IOException
public void clear() throws java.io.IOException
java.io.IOException
public void clearBuffer() throws java.io.IOException
java.io.IOException
public void flush() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public int getRemaining()
public void newLine() throws java.io.IOException
java.io.IOException
public void write(char[] value, int offset, int length) throws java.io.IOException
java.io.IOException
public void print(boolean value) throws java.io.IOException
java.io.IOException
public void print(char value) throws java.io.IOException
java.io.IOException
public void print(char[] value) throws java.io.IOException
java.io.IOException
public void print(double value) throws java.io.IOException
java.io.IOException
public void print(float value) throws java.io.IOException
java.io.IOException
public void print(int value) throws java.io.IOException
java.io.IOException
public void print(long value) throws java.io.IOException
java.io.IOException
public void print(java.lang.Object value) throws java.io.IOException
java.io.IOException
public void print(java.lang.String value) throws java.io.IOException
java.io.IOException
public void println() throws java.io.IOException
java.io.IOException
public void println(boolean value) throws java.io.IOException
java.io.IOException
public void println(char value) throws java.io.IOException
java.io.IOException
public void println(char[] value) throws java.io.IOException
java.io.IOException
public void println(double value) throws java.io.IOException
java.io.IOException
public void println(float value) throws java.io.IOException
java.io.IOException
public void println(int value) throws java.io.IOException
java.io.IOException
public void println(long value) throws java.io.IOException
java.io.IOException
public void println(java.lang.Object value) throws java.io.IOException
java.io.IOException
public void println(java.lang.String value) throws java.io.IOException
java.io.IOException