FileDocCategorySizeDatePackage
ServletResponseWrapper.javaAPI DocGlassfish v2 API6722Fri May 04 22:34:20 BST 2007javax.servlet

ServletResponseWrapper

public class ServletResponseWrapper extends Object implements ServletResponse
Provides a convenient implementation of the ServletResponse interface that can be subclassed by developers wishing to adapt the response from a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped response object.
author
Various
since
v 2.3
see
javax.servlet.ServletResponse

Fields Summary
private ServletResponse
response
Constructors Summary
public ServletResponseWrapper(ServletResponse response)
Creates a ServletResponse adaptor wrapping the given response object.

throws
java.lang.IllegalArgumentException if the response is null.

	    if (response == null) {
		throw new IllegalArgumentException("Response cannot be null");
	    }
	    this.response = response;
	
Methods Summary
public voidflushBuffer()
The default behavior of this method is to call flushBuffer() on the wrapped response object.

	this.response.flushBuffer();
    
public intgetBufferSize()
The default behavior of this method is to return getBufferSize() on the wrapped response object.

	return this.response.getBufferSize();
    
public java.lang.StringgetCharacterEncoding()
The default behavior of this method is to return getCharacterEncoding() on the wrapped response object.

	return this.response.getCharacterEncoding();
	
public java.lang.StringgetContentType()
The default behavior of this method is to return getContentType() on the wrapped response object.

since
2.4

	return this.response.getContentType();
    
public java.util.LocalegetLocale()
The default behavior of this method is to return getLocale() on the wrapped response object.

	return this.response.getLocale();
    
public javax.servlet.ServletOutputStreamgetOutputStream()
The default behavior of this method is to return getOutputStream() on the wrapped response object.

	return this.response.getOutputStream();
    
public javax.servlet.ServletResponsegetResponse()
Return the wrapped ServletResponse object.

		return this.response;
	
public java.io.PrintWritergetWriter()
The default behavior of this method is to return getWriter() on the wrapped response object.

	return this.response.getWriter();
	
public booleanisCommitted()
The default behavior of this method is to return isCommitted() on the wrapped response object.

	return this.response.isCommitted();
    
public voidreset()
The default behavior of this method is to call reset() on the wrapped response object.

	this.response.reset();
    
public voidresetBuffer()
The default behavior of this method is to call resetBuffer() on the wrapped response object.

	this.response.resetBuffer();
    
public voidsetBufferSize(int size)
The default behavior of this method is to call setBufferSize(int size) on the wrapped response object.

	this.response.setBufferSize(size);
    
public voidsetCharacterEncoding(java.lang.String charset)
The default behavior of this method is to call setCharacterEncoding(String charset) on the wrapped response object.

since
2.4

	this.response.setCharacterEncoding(charset);
    
public voidsetContentLength(int len)
The default behavior of this method is to call setContentLength(int len) on the wrapped response object.

	this.response.setContentLength(len);
    
public voidsetContentType(java.lang.String type)
The default behavior of this method is to call setContentType(String type) on the wrapped response object.

	this.response.setContentType(type);
    
public voidsetLocale(java.util.Locale loc)
The default behavior of this method is to call setLocale(Locale loc) on the wrapped response object.

	this.response.setLocale(loc);
    
public voidsetResponse(javax.servlet.ServletResponse response)
Sets the response being wrapped.

throws
java.lang.IllegalArgumentException if the response is null.

	    if (response == null) {
		throw new IllegalArgumentException("Response cannot be null");
	    }
	    this.response = response;