Package org.vx68k.bitbucket.stub
Class StubServletResponse
- java.lang.Object
-
- org.vx68k.bitbucket.stub.StubServletResponse
-
- All Implemented Interfaces:
ServletResponse
- Direct Known Subclasses:
StubHttpServletResponse
public class StubServletResponse extends Object implements ServletResponse
Stub implementation ofServletResponse
.- Since:
- 5.0
- Author:
- Kaz Nishimura
-
-
Constructor Summary
Constructors Constructor Description StubServletResponse(ServletOutputStream stream)
Constructs this object with aServletOutputStream
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkNotCommitted()
Checks if this response is not committed.protected void
commit()
Marks this response is committed.void
flushBuffer()
int
getBufferSize()
String
getCharacterEncoding()
String
getContentType()
Locale
getLocale()
ServletOutputStream
getOutputStream()
PrintWriter
getWriter()
boolean
isCommitted()
void
reset()
void
resetBuffer()
void
setBufferSize(int size)
void
setCharacterEncoding(String value)
void
setContentLength(int contentLength)
void
setContentLengthLong(long len)
void
setContentType(String value)
void
setLocale(Locale value)
-
-
-
Constructor Detail
-
StubServletResponse
public StubServletResponse(ServletOutputStream stream)
Constructs this object with aServletOutputStream
object.- Parameters:
stream
-ServletOutputStream
object
-
-
Method Detail
-
commit
protected final void commit()
Marks this response is committed.
-
checkNotCommitted
protected final void checkNotCommitted()
Checks if this response is not committed.- Throws:
IllegalStateException
- if this response is committed
-
getOutputStream
public final ServletOutputStream getOutputStream()
- Specified by:
getOutputStream
in interfaceServletResponse
-
getWriter
public final PrintWriter getWriter()
- Specified by:
getWriter
in interfaceServletResponse
-
reset
public void reset()
- Specified by:
reset
in interfaceServletResponse
-
flushBuffer
public void flushBuffer() throws IOException
- Specified by:
flushBuffer
in interfaceServletResponse
- Throws:
IOException
-
resetBuffer
public void resetBuffer()
- Specified by:
resetBuffer
in interfaceServletResponse
-
isCommitted
public final boolean isCommitted()
- Specified by:
isCommitted
in interfaceServletResponse
-
getBufferSize
public int getBufferSize()
- Specified by:
getBufferSize
in interfaceServletResponse
-
setBufferSize
public void setBufferSize(int size)
- Specified by:
setBufferSize
in interfaceServletResponse
-
getContentType
public final String getContentType()
- Specified by:
getContentType
in interfaceServletResponse
-
setContentType
public final void setContentType(String value)
- Specified by:
setContentType
in interfaceServletResponse
-
getCharacterEncoding
public final String getCharacterEncoding()
- Specified by:
getCharacterEncoding
in interfaceServletResponse
-
setCharacterEncoding
public final void setCharacterEncoding(String value)
- Specified by:
setCharacterEncoding
in interfaceServletResponse
-
getLocale
public final Locale getLocale()
- Specified by:
getLocale
in interfaceServletResponse
-
setLocale
public final void setLocale(Locale value)
- Specified by:
setLocale
in interfaceServletResponse
-
setContentLength
public void setContentLength(int contentLength)
- Specified by:
setContentLength
in interfaceServletResponse
-
setContentLengthLong
public void setContentLengthLong(long len)
- Specified by:
setContentLengthLong
in interfaceServletResponse
-
-