类 MockJspWriter
- java.lang.Object
- java.io.Writer
- javax.servlet.jsp.JspWriter
- org.springframework.mock.web.MockJspWriter
- 所有已实现的接口:
Closeable,Flushable,Appendable,AutoCloseable
public class MockJspWriter extends JspWriter
Mock implementation of theJspWriterclass. Only necessary for testing applications when testing custom JSP tags.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
字段概要
从类继承的字段 javax.servlet.jsp.JspWriter
autoFlush, bufferSize, DEFAULT_BUFFER, NO_BUFFER, UNBOUNDED_BUFFER
构造器概要
构造器 构造器 说明 MockJspWriter(Writer targetWriter)Create a MockJspWriter for the given plain Writer.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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclear()voidclearBuffer()voidclose()voidflush()intgetRemaining()protected PrintWritergetTargetWriter()Lazily initialize the target Writer.voidnewLine()voidprint(boolean value)voidprint(char value)voidprint(char[] value)voidprint(double value)voidprint(float value)voidprint(int value)voidprint(long value)voidprint(Object value)voidprint(String value)voidprintln()voidprintln(boolean value)voidprintln(char value)voidprintln(char[] value)voidprintln(double value)voidprintln(float value)voidprintln(int value)voidprintln(long value)voidprintln(Object value)voidprintln(String value)voidwrite(char[] value, int offset, int length)从类继承的方法 javax.servlet.jsp.JspWriter
getBufferSize, isAutoFlush
构造器详细资料
MockJspWriter
public MockJspWriter(HttpServletResponse response)
Create a MockJspWriter for the given response, using the response's default Writer.- 参数:
response- the servlet response to wrap
MockJspWriter
public MockJspWriter(Writer targetWriter)
Create a MockJspWriter for the given plain Writer.- 参数:
targetWriter- the target Writer to wrap
MockJspWriter
public MockJspWriter(@Nullable HttpServletResponse response, @Nullable Writer targetWriter)
Create a MockJspWriter for the given response.- 参数:
response- the servlet response to wraptargetWriter- the target Writer to wrap
方法详细资料
getTargetWriter
protected PrintWriter getTargetWriter() throws IOException
Lazily initialize the target Writer.- 抛出:
IOException
clear
public void clear() throws IOException
- 指定者:
clear在类中JspWriter- 抛出:
IOException
clearBuffer
public void clearBuffer() throws IOException
- 指定者:
clearBuffer在类中JspWriter- 抛出:
IOException
flush
public void flush() throws IOException
- 指定者:
flush在接口中Flushable- 指定者:
flush在类中JspWriter- 抛出:
IOException
close
public void close() throws IOException
- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 指定者:
close在类中JspWriter- 抛出:
IOException
getRemaining
public int getRemaining()
- 指定者:
getRemaining在类中JspWriter
newLine
public void newLine() throws IOException
- 指定者:
newLine在类中JspWriter- 抛出:
IOException
write
public void write(char[] value, int offset, int length) throws IOException
- 指定者:
write在类中Writer- 抛出:
IOException
print
public void print(boolean value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
print
public void print(char value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
print
public void print(char[] value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
print
public void print(double value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
print
public void print(float value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
print
public void print(int value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
print
public void print(long value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
print
public void print(Object value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
print
public void print(String value) throws IOException
- 指定者:
print在类中JspWriter- 抛出:
IOException
println
public void println() throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(boolean value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(char value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(char[] value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(double value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(float value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(int value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(long value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(Object value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException
println
public void println(String value) throws IOException
- 指定者:
println在类中JspWriter- 抛出:
IOException