public class

MockBodyContent

extends BodyContent
java.lang.Object
   ↳ BodyContent
     ↳ org.springframework.mock.web.MockBodyContent

Class Overview

Mock implementation of the javax.servlet.jsp.tagext.BodyContent class.

Used for testing the web framework; only necessary for testing applications when testing custom JSP tags.

Summary

Public Constructors
MockBodyContent(String content, HttpServletResponse response)
Create a MockBodyContent for the given response.
MockBodyContent(String content, Writer targetWriter)
Create a MockBodyContent for the given response.
MockBodyContent(String content, HttpServletResponse response, Writer targetWriter)
Create a MockBodyContent for the given response.
Public Methods
void clear()
void clearBuffer()
void close()
Reader getReader()
int getRemaining()
String getString()
void newLine()
void print(float value)
void print(double value)
void print(String value)
void print(Object value)
void print(char value)
void print(char[] value)
void print(long value)
void print(int value)
void print(boolean value)
void println()
void println(float value)
void println(int value)
void println(long value)
void println(Object value)
void println(char[] value)
void println(String value)
void println(char value)
void println(double value)
void println(boolean value)
void write(char[] value, int offset, int length)
void writeOut(Writer writer)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MockBodyContent (String content, HttpServletResponse response)

Create a MockBodyContent for the given response.

Parameters
content the body content to expose
response the servlet response to wrap

public MockBodyContent (String content, Writer targetWriter)

Create a MockBodyContent for the given response.

Parameters
content the body content to expose
targetWriter the target Writer to wrap

public MockBodyContent (String content, HttpServletResponse response, Writer targetWriter)

Create a MockBodyContent for the given response.

Parameters
content the body content to expose
response the servlet response to wrap
targetWriter the target Writer to wrap

Public Methods

public void clear ()

Throws
IOException

public void clearBuffer ()

Throws
IOException

public void close ()

Throws
IOException

public Reader getReader ()

public int getRemaining ()

public String getString ()

public void newLine ()

Throws
IOException

public void print (float value)

Throws
IOException

public void print (double value)

Throws
IOException

public void print (String value)

Throws
IOException

public void print (Object value)

Throws
IOException

public void print (char value)

Throws
IOException

public void print (char[] value)

Throws
IOException

public void print (long value)

Throws
IOException

public void print (int value)

Throws
IOException

public void print (boolean value)

Throws
IOException

public void println ()

Throws
IOException

public void println (float value)

Throws
IOException

public void println (int value)

Throws
IOException

public void println (long value)

Throws
IOException

public void println (Object value)

Throws
IOException

public void println (char[] value)

Throws
IOException

public void println (String value)

Throws
IOException

public void println (char value)

Throws
IOException

public void println (double value)

Throws
IOException

public void println (boolean value)

Throws
IOException

public void write (char[] value, int offset, int length)

Throws
IOException

public void writeOut (Writer writer)

Throws
IOException