|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.engine.AbstractResponse
public abstract class AbstractResponse
This abstract class implements parts of the Response interface to
provide behaviour that is specific to RIFE.
Additional abstract methods have been provided to integrate with the
concrete back-end classes that extend AbstractResponse.
| Constructor Summary | |
|---|---|
protected |
AbstractResponse(Request request,
boolean embedded)
Constructor that needs to be called by all the constructors of the extending classes. |
| Method Summary | |
|---|---|
protected abstract String |
_getCharacterEncoding()
This method needs to be implemented by the extending back-end class and will be called by AbstractResponse during the
RIFE-specific additional behaviour. |
protected abstract OutputStream |
_getOutputStream()
This method needs to be implemented by the extending back-end class and will be called by AbstractResponse during the
RIFE-specific additional behaviour. |
protected abstract void |
_sendRedirect(String location)
This method needs to be implemented by the extending back-end class and will be called by AbstractResponse during the
RIFE-specific additional behaviour. |
protected abstract void |
_setContentLength(int length)
This method needs to be implemented by the extending back-end class and will be called by AbstractResponse during the
RIFE-specific additional behaviour. |
protected abstract void |
_setContentType(String contentType)
This method needs to be implemented by the extending back-end class and will be called by AbstractResponse during the
RIFE-specific additional behaviour. |
void |
clearBuffer()
Clears the text buffer is it's enabled. |
void |
close()
Closed the content output stream. |
void |
enableTextBuffer(boolean enabled)
Enables or disabled the text output buffer. |
void |
flush()
Forces all the streamed content to be output to the client. |
String |
getCharacterEncoding()
See ServletResponse.getCharacterEncoding(). |
String |
getContentType()
Retrieves the content type that was explicitly set for this response. |
ArrayList<CharSequence> |
getEmbeddedContent()
Retrieves the content of the response for embedded usage and integration into another response. |
ElementSupport |
getLastElement()
Retrieves the last element that has been processed with this response. |
OutputStream |
getOutputStream()
See ServletResponse.getOutputStream(). |
Request |
getRequest()
Retrieves the request that is associated with this response. |
boolean |
isContentTypeSet()
Indicates whether this response's content type has been explicitly set. |
boolean |
isEmbedded()
Indicates whether this response is embedded into another response. |
boolean |
isTextBufferEnabled()
Indicates whether the text output buffer is enabled. |
void |
print(Collection<CharSequence> deferredContent)
Prints a list of text snippets to the request text output. |
void |
print(Object value)
Prints the string representation of an object to the request text output. |
void |
print(Template template)
Prints the content of a template to the request text output. |
void |
sendRedirect(String location)
See HttpServletResponse.sendRedirect(String). |
void |
setContentLength(int length)
See ServletResponse.setContentLength(int). |
void |
setContentType(String contentType)
See ServletResponse.setContentType(String). |
void |
setLastElement(ElementSupport element)
Sets the latest target element of this response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.uwyn.rife.engine.Response |
|---|
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, createEmbeddedResponse, encodeURL, getHttpServletResponse, getLocale, getWriter, sendError, sendError, setDateHeader, setHeader, setIntHeader, setLocale, setStatus |
| Constructor Detail |
|---|
protected AbstractResponse(Request request,
boolean embedded)
request - the Request that is associated with this
responseembedded - true if the response is embedded; or
false otherwise
| Method Detail |
|---|
protected abstract void _setContentType(String contentType)
AbstractResponse during the
RIFE-specific additional behaviour. It behaves exactly like its counter-part in the Response interface.
Response.setContentType(String)protected abstract String _getCharacterEncoding()
AbstractResponse during the
RIFE-specific additional behaviour. It behaves exactly like its counter-part in the Response interface.
Response.getCharacterEncoding()protected abstract void _setContentLength(int length)
AbstractResponse during the
RIFE-specific additional behaviour. It behaves exactly like its counter-part in the Response interface.
Response.setContentLength(int)protected abstract void _sendRedirect(String location)
AbstractResponse during the
RIFE-specific additional behaviour. It behaves exactly like its counter-part in the Response interface.
Response.sendRedirect(String)
protected abstract OutputStream _getOutputStream()
throws IOException
AbstractResponse during the
RIFE-specific additional behaviour. It behaves exactly like its counter-part in the Request interface.
IOExceptionResponse.getOutputStream()public Request getRequest()
public ElementSupport getLastElement()
public void setLastElement(ElementSupport element)
Response
setLastElement in interface Responseelement - an element that has been executed in the context of this
responsepublic ArrayList<CharSequence> getEmbeddedContent()
Response
getEmbeddedContent in interface Responsenull if the response is not embedded.
public boolean isEmbedded()
Response
isEmbedded in interface Responsetrue if the response is embedded; or
false otherwise.
public boolean isContentTypeSet()
Response
isContentTypeSet in interface Responsetrue if it has been set; or
false otherwise
Response.setContentType(java.lang.String)public String getContentType()
Response
getContentType in interface Responsenull if the content type wasn't set
Response.setContentType(java.lang.String)public void setContentType(String contentType)
ResponseServletResponse.setContentType(String).
setContentType in interface Responsepublic void enableTextBuffer(boolean enabled)
ResponseThe buffer is enabled by default and its buffered contents will be flushed when the buffer is disabled.
enableTextBuffer in interface Responseenabled - true to enable the text buffer; or
false to disable it
public boolean isTextBufferEnabled()
Response
isTextBufferEnabled in interface Responsetrue when the text buffer is enabled; or
false when it is disabled.
public void print(Template template)
throws EngineException
Response
print in interface Responsetemplate - the template that will be printed
EngineException - if an error
occurs during the output of the template contentResponse.print(Collection),
Response.print(Object)
public void print(Collection<CharSequence> deferredContent)
throws EngineException
Response
print in interface ResponsedeferredContent - the text snippets that will be printed
EngineException - if an error
occurs during the output of the text snippetsResponse.print(Template),
Response.print(Object)
public void print(Object value)
throws EngineException
ResponseString.valueOf(value) call.
print in interface Responsevalue - the object that will be output
EngineException - if an error
occurs during the output of the contentResponse.print(Template),
Response.print(Collection)public String getCharacterEncoding()
ResponseServletResponse.getCharacterEncoding().
getCharacterEncoding in interface Responsepublic void clearBuffer()
ResponseIf the text buffer is disabled, this method does nothing.
clearBuffer in interface Response
public void flush()
throws EngineException
ResponseIf the text buffer is enabled, this will flush its content to the output stream first.
flush in interface ResponseEngineException
public void close()
throws EngineException
ResponseAll content is flushed first.
close in interface ResponseEngineException
public OutputStream getOutputStream()
throws EngineException
ResponseServletResponse.getOutputStream().
getOutputStream in interface ResponseEngineException
public void setContentLength(int length)
throws EngineException
ResponseServletResponse.setContentLength(int).
setContentLength in interface ResponseEngineException
public void sendRedirect(String location)
throws EngineException
ResponseHttpServletResponse.sendRedirect(String).
sendRedirect in interface ResponseEngineException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||