public class ServletResponseWrapper extends java.lang.Object implements ServletResponse
ServletResponse
interface fall
through to the underlying wrapped object.Constructor and Description |
---|
ServletResponseWrapper(ServletResponse response)
Create a new ServletResponseWrapper by wrapping the supplied
ServletResponse.
|
Modifier and Type | Method and Description |
---|---|
void |
flushBuffer()
fall through to the underlying object by default.
|
int |
getBufferSize()
fall through to the underlying object by default.
|
java.lang.String |
getCharacterEncoding()
fall through to the underlying object by default.
|
java.lang.String |
getContentType()
get the content type
|
java.util.Locale |
getLocale()
fall through to the underlying object by default.
|
ServletOutputStream |
getOutputStream()
fall through to the underlying object by default.
|
ServletResponse |
getResponse()
get the response from the wrapper.
|
java.io.PrintWriter |
getWriter()
fall through to the underlying object by default.
|
boolean |
isCommitted()
fall through to the underlying object by default.
|
boolean |
isWrapperFor(java.lang.Class wrappedType)
Indicates if this wrapper wraps a response of the specified class.
|
boolean |
isWrapperFor(ServletResponse wrapped)
Indicates if this wrapper wraps the specified response.
|
void |
reset()
fall through to the underlying object by default.
|
void |
resetBuffer()
fall through to the underlying object by default.
|
void |
setBufferSize(int size)
fall through to the underlying object by default.
|
void |
setCharacterEncoding(java.lang.String enc)
set the character encoding.
|
void |
setContentLength(int length)
fall through to the underlying object by default.
|
void |
setContentType(java.lang.String type)
fall through to the underlying object by default.
|
void |
setLocale(java.util.Locale locale)
fall through to the underlying object by default.
|
void |
setResponse(ServletResponse response)
set a new wrapper
|
public ServletResponseWrapper(ServletResponse response)
response
- the object to be wrappedjava.lang.IllegalArgumentException
- if wrappedResponse is nullpublic ServletResponse getResponse()
public void setResponse(ServletResponse response)
response
- the object to be wrappedjava.lang.IllegalArgumentException
- if wrappedResponse is nullpublic void setCharacterEncoding(java.lang.String enc)
setCharacterEncoding
in interface ServletResponse
enc
- the character encodingpublic java.lang.String getCharacterEncoding()
getCharacterEncoding
in interface ServletResponse
public ServletOutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface ServletResponse
java.io.IOException
- if a i/o exception occurswhich the container might use to provide a buffer
for this stream.
public java.io.PrintWriter getWriter() throws java.io.IOException
getWriter
in interface ServletResponse
java.io.IOException
java.io.UnsupportedEncodingException
java.lang.IllegalStateException
which must be called before this if you want to
specify a charset to affect this writer.
public void setContentLength(int length)
setContentLength
in interface ServletResponse
length
- the number of bytes in the replypublic void setContentType(java.lang.String type)
setContentType
in interface ServletResponse
type
- the mime type of the contentpublic java.lang.String getContentType()
getContentType
in interface ServletResponse
public void setBufferSize(int size)
setBufferSize
in interface ServletResponse
size
- the size in bytes of the bufferpublic int getBufferSize()
getBufferSize
in interface ServletResponse
public void flushBuffer() throws java.io.IOException
flushBuffer
in interface ServletResponse
java.io.IOException
public boolean isCommitted()
isCommitted
in interface ServletResponse
public void reset()
reset
in interface ServletResponse
java.lang.IllegalStateException
public void resetBuffer()
resetBuffer
in interface ServletResponse
public void setLocale(java.util.Locale locale)
setLocale
in interface ServletResponse
public java.util.Locale getLocale()
getLocale
in interface ServletResponse
public boolean isWrapperFor(ServletResponse wrapped)
public boolean isWrapperFor(java.lang.Class wrappedType)