com.mockrunner.mock.web
Class MockJspWriter
java.lang.Object
java.io.Writer
javax.servlet.jsp.JspWriter
com.mockrunner.mock.web.MockJspWriter
- public class MockJspWriter
- extends javax.servlet.jsp.JspWriter
Mock implementation of JspWriter
.
Collects the output data. If you provide a Writer
in the constructor, the output data is written to this
provided Writer
. The method getOutputAsString()
returns an empty string in this case. Otherwise it returns the
collected data.
Fields inherited from class javax.servlet.jsp.JspWriter |
autoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER |
Fields inherited from class java.io.Writer |
lock |
Methods inherited from class javax.servlet.jsp.JspWriter |
getBufferSize, isAutoFlush |
Methods inherited from class java.io.Writer |
write, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
MockJspWriter
public MockJspWriter()
MockJspWriter
public MockJspWriter(java.io.Writer writer)
getOutputAsString
public java.lang.String getOutputAsString()
- Returns the output or an empty string, if
an output
Writer
was provided
in the constructor.
- Returns:
- the output or an empty string
toString
public java.lang.String toString()
- Delegates to
getOutputAsString()
clear
public void clear()
throws java.io.IOException
- Clears the output. This method throws an
IOException
,
if a Writer
was provided according to spec.
- Throws:
java.io.IOException
clearBuffer
public void clearBuffer()
throws java.io.IOException
- Clears the output. This method does nothing,
if a
Writer
was provided according to spec.
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Throws:
java.io.IOException
getRemaining
public int getRemaining()
flush
public void flush()
throws java.io.IOException
- Throws:
java.io.IOException
newLine
public void newLine()
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(boolean value)
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(char value)
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(char[] value)
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(double value)
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(float value)
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(int value)
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(long value)
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(java.lang.Object value)
throws java.io.IOException
- Throws:
java.io.IOException
print
public void print(java.lang.String value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println()
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(boolean value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(char value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(char[] value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(double value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(float value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(int value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(long value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(java.lang.Object value)
throws java.io.IOException
- Throws:
java.io.IOException
println
public void println(java.lang.String value)
throws java.io.IOException
- Throws:
java.io.IOException
write
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Throws:
java.io.IOException