java.lang.Object
javax.servlet.ServletResponseWrapper
- All Implemented Interfaces:
ServletResponse
- Direct Known Subclasses:
HttpServletResponseWrapper
public class ServletResponseWrapper extends java.lang.Object implements ServletResponse
The ServletResponseWrapper API.
- Author:
- Manfred Riem ([email protected])
-
Constructor Summary
Constructors Constructor Description ServletResponseWrapper(ServletResponse wrapped)
Constructor. -
Method Summary
Modifier and Type Method Description void
flushBuffer()
Flush the buffer.int
getBufferSize()
Get the buffer size.java.lang.String
getCharacterEncoding()
Get the character encoding.java.lang.String
getContentType()
Get the content type.java.util.Locale
getLocale()
Get the locale.ServletOutputStream
getOutputStream()
Get the output stream.ServletResponse
getResponse()
Get the wrapped response.java.io.PrintWriter
getWriter()
Get the writer.boolean
isCommitted()
Is committed.boolean
isWrapperFor(java.lang.Class<?> wrappedType)
Is wrapper for.boolean
isWrapperFor(ServletResponse wrapped)
Is wrapper for.void
reset()
Reset.void
resetBuffer()
Reset the buffer.void
setBufferSize(int bufferSize)
Set the buffer size.void
setCharacterEncoding(java.lang.String characterEncoding)
Set the character encoding.void
setContentLength(int contentLength)
Set the content length.void
setContentLengthLong(long contentLength)
Set the content length.void
setContentType(java.lang.String contentType)
Set the content type.void
setLocale(java.util.Locale locale)
Set the locale.void
setResponse(ServletResponse wrapped)
Set the wrapped response.
-
Constructor Details
-
ServletResponseWrapper
Constructor.- Parameters:
wrapped
- the wrapped response.
-
-
Method Details
-
flushBuffer
public void flushBuffer() throws java.io.IOExceptionFlush the buffer.- Specified by:
flushBuffer
in interfaceServletResponse
- Throws:
java.io.IOException
- when an I/O error occurs.
-
getBufferSize
public int getBufferSize()Get the buffer size.- Specified by:
getBufferSize
in interfaceServletResponse
- Returns:
- the buffer size.
-
getCharacterEncoding
public java.lang.String getCharacterEncoding()Get the character encoding.- Specified by:
getCharacterEncoding
in interfaceServletResponse
- Returns:
- the character encoding.
-
getContentType
public java.lang.String getContentType()Get the content type.- Specified by:
getContentType
in interfaceServletResponse
- Returns:
- the content type.
-
getLocale
public java.util.Locale getLocale()Get the locale.- Specified by:
getLocale
in interfaceServletResponse
- Returns:
- the locale.
-
getOutputStream
Get the output stream.- Specified by:
getOutputStream
in interfaceServletResponse
- Returns:
- the output stream.
- Throws:
java.io.IOException
- when an I/O error occurs.
-
getResponse
Get the wrapped response.- Returns:
- the wrapped response.
-
getWriter
public java.io.PrintWriter getWriter() throws java.io.IOExceptionGet the writer.- Specified by:
getWriter
in interfaceServletResponse
- Returns:
- the writer.
- Throws:
java.io.IOException
- when an I/O error occurs.
-
isCommitted
public boolean isCommitted()Is committed.- Specified by:
isCommitted
in interfaceServletResponse
- Returns:
- true if it is, false otherwise.
-
isWrapperFor
Is wrapper for.- Parameters:
wrapped
- the wrapped response.- Returns:
- true if we wrap it, false otherwise.
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> wrappedType)Is wrapper for.- Parameters:
wrappedType
- the wrapped type.- Returns:
- true if we wrap it, false otherwise.
-
reset
public void reset()Reset.- Specified by:
reset
in interfaceServletResponse
-
resetBuffer
public void resetBuffer()Reset the buffer.- Specified by:
resetBuffer
in interfaceServletResponse
-
setBufferSize
public void setBufferSize(int bufferSize)Set the buffer size.- Specified by:
setBufferSize
in interfaceServletResponse
- Parameters:
bufferSize
- the buffer size.
-
setCharacterEncoding
public void setCharacterEncoding(java.lang.String characterEncoding)Set the character encoding.- Specified by:
setCharacterEncoding
in interfaceServletResponse
- Parameters:
characterEncoding
- the character encoding.
-
setContentLength
public void setContentLength(int contentLength)Set the content length.- Specified by:
setContentLength
in interfaceServletResponse
- Parameters:
contentLength
- the content length.
-
setContentLengthLong
public void setContentLengthLong(long contentLength)Set the content length.- Specified by:
setContentLengthLong
in interfaceServletResponse
- Parameters:
contentLength
- the content length.
-
setContentType
public void setContentType(java.lang.String contentType)Set the content type.- Specified by:
setContentType
in interfaceServletResponse
- Parameters:
contentType
- the content type.
-
setLocale
public void setLocale(java.util.Locale locale)Set the locale.- Specified by:
setLocale
in interfaceServletResponse
- Parameters:
locale
- the locale.
-
setResponse
Set the wrapped response.- Parameters:
wrapped
- the wrapped response.
-