类 MockBodyContent

java.lang.Object
java.io.Writer
jakarta.servlet.jsp.JspWriter
jakarta.servlet.jsp.tagext.BodyContent
cn.taketoday.mock.web.MockBodyContent
所有已实现的接口:
Closeable, Flushable, Appendable, AutoCloseable

public class MockBodyContent extends jakarta.servlet.jsp.tagext.BodyContent
Mock implementation of the BodyContent class. Only necessary for testing applications when testing custom JSP tags.
从以下版本开始:
4.0
作者:
Juergen Hoeller
  • 字段详细资料

    • content

      private final String content
  • 构造器详细资料

    • MockBodyContent

      public MockBodyContent(String content, jakarta.servlet.http.HttpServletResponse response)
      Create a MockBodyContent for the given response.
      参数:
      content - the body content to expose
      response - the servlet response to wrap
    • MockBodyContent

      public MockBodyContent(String content, Writer targetWriter)
      Create a MockBodyContent for the given response.
      参数:
      content - the body content to expose
      targetWriter - the target Writer to wrap
    • MockBodyContent

      public MockBodyContent(String content, @Nullable jakarta.servlet.http.HttpServletResponse response, @Nullable Writer targetWriter)
      Create a MockBodyContent for the given response.
      参数:
      content - the body content to expose
      response - the servlet response to wrap
      targetWriter - the target Writer to wrap
  • 方法详细资料

    • adaptJspWriter

      private static jakarta.servlet.jsp.JspWriter adaptJspWriter(@Nullable Writer targetWriter, @Nullable jakarta.servlet.http.HttpServletResponse response)
    • getReader

      public Reader getReader()
      指定者:
      getReader 在类中 jakarta.servlet.jsp.tagext.BodyContent
    • getString

      public String getString()
      指定者:
      getString 在类中 jakarta.servlet.jsp.tagext.BodyContent
    • writeOut

      public void writeOut(Writer writer) throws IOException
      指定者:
      writeOut 在类中 jakarta.servlet.jsp.tagext.BodyContent
      抛出:
      IOException
    • clear

      public void clear() throws IOException
      指定者:
      clear 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • clearBuffer

      public void clearBuffer() throws IOException
      指定者:
      clearBuffer 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • close

      public void close() throws IOException
      指定者:
      close 在接口中 AutoCloseable
      指定者:
      close 在接口中 Closeable
      指定者:
      close 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • getRemaining

      public int getRemaining()
      指定者:
      getRemaining 在类中 jakarta.servlet.jsp.JspWriter
    • newLine

      public void newLine() throws IOException
      指定者:
      newLine 在类中 jakarta.servlet.jsp.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 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • print

      public void print(char value) throws IOException
      指定者:
      print 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • print

      public void print(char[] value) throws IOException
      指定者:
      print 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • print

      public void print(double value) throws IOException
      指定者:
      print 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • print

      public void print(float value) throws IOException
      指定者:
      print 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • print

      public void print(int value) throws IOException
      指定者:
      print 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • print

      public void print(long value) throws IOException
      指定者:
      print 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • print

      public void print(Object value) throws IOException
      指定者:
      print 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • print

      public void print(String value) throws IOException
      指定者:
      print 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println() throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(boolean value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(char value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(char[] value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(double value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(float value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(int value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(long value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(Object value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException
    • println

      public void println(String value) throws IOException
      指定者:
      println 在类中 jakarta.servlet.jsp.JspWriter
      抛出:
      IOException