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,
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) |
getBufferSize, isAutoFlush
public MockJspWriter(HttpServletResponse response)
response
- the servlet response to wrappublic MockJspWriter(java.io.Writer targetWriter)
targetWriter
- the target Writer 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
public void clearBuffer() throws java.io.IOException
clearBuffer
in class JspWriter
java.io.IOException
public void flush() throws java.io.IOException
public void close() throws java.io.IOException
public int getRemaining()
getRemaining
in class JspWriter
public void newLine() throws java.io.IOException
public void write(char[] value, int offset, int length) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public 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