com.uwyn.rife.engine
Interface Response

All Known Implementing Classes:
AbstractResponse, HttpResponse, MockResponse

public interface Response

This interface contains all the methods that the web engine needs to be able to send a response to the client.

Since:
1.1
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Method Summary
 void addCookie(Cookie cookie)
          See HttpServletResponse.addCookie(Cookie).
 void addDateHeader(String name, long date)
          See HttpServletResponse.addDateHeader(String, long).
 void addHeader(String name, String value)
          See HttpServletResponse.addHeader(String, String).
 void addIntHeader(String name, int integer)
          See HttpServletResponse.addIntHeader(String, int).
 void clearBuffer()
          Clears the text buffer is it's enabled.
 void close()
          Closed the content output stream.
 boolean containsHeader(String name)
          See HttpServletResponse.containsHeader(String).
 Response createEmbeddedResponse(String valueId, String differentiator)
          Creates a new Response instance that will be used for embedded elements.
 void enableTextBuffer(boolean enabled)
          Enables or disabled the text output buffer.
 String encodeURL(String url)
          See HttpServletResponse.encodeURL(String).
 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.
 HttpServletResponse getHttpServletResponse()
          Retrieves the underlying HttpServletResponse.
 Locale getLocale()
          See ServletResponse.getLocale().
 OutputStream getOutputStream()
          See ServletResponse.getOutputStream().
 PrintWriter getWriter()
          See ServletResponse.getWriter().
 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 sendError(int statusCode)
          See HttpServletResponse.sendError(int).
 void sendError(int statusCode, String message)
          See HttpServletResponse.sendError(int, String).
 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 setDateHeader(String name, long date)
          See HttpServletResponse.setDateHeader(String, long).
 void setHeader(String name, String value)
          See HttpServletResponse.setHeader(String, String).
 void setIntHeader(String name, int value)
          See HttpServletResponse.setIntHeader(String, int).
 void setLastElement(ElementSupport element)
          Sets the latest target element of this response.
 void setLocale(Locale locale)
          See ServletResponse.setLocale(Locale).
 void setStatus(int statusCode)
          See HttpServletResponse.setStatus(int).
 

Method Detail

createEmbeddedResponse

Response createEmbeddedResponse(String valueId,
                                String differentiator)
Creates a new Response instance that will be used for embedded elements.

Parameters:
valueId - the template value in which the embedded element will be processed
differentiator - the embedded element differentiator
Returns:
the new Response instance for embedded use
Since:
1.5

getEmbeddedContent

ArrayList<CharSequence> getEmbeddedContent()
Retrieves the content of the response for embedded usage and integration into another response.

Returns:
the embedded content; or

null if the response is not embedded.

Since:
1.1

isEmbedded

boolean isEmbedded()
Indicates whether this response is embedded into another response.

Returns:
true if the response is embedded; or

false otherwise.

Since:
1.1

setLastElement

void setLastElement(ElementSupport element)
Sets the latest target element of this response. This method is called repeatedly by the engine to make it possible to trace which elements have been processed.

Parameters:
element - an element that has been executed in the context of this response
Since:
1.1

enableTextBuffer

void enableTextBuffer(boolean enabled)
Enables or disabled the text output buffer.

The buffer is enabled by default and its buffered contents will be flushed when the buffer is disabled.

Parameters:
enabled - true to enable the text buffer; or

false to disable it

Since:
1.1

isTextBufferEnabled

boolean isTextBufferEnabled()
Indicates whether the text output buffer is enabled.

Returns:
true when the text buffer is enabled; or

false when it is disabled.

Since:
1.1

print

void print(Template template)
           throws EngineException
Prints the content of a template to the request text output.

Parameters:
template - the template that will be printed
Throws:
EngineException - if an error occurs during the output of the template content
Since:
1.1
See Also:
print(Collection), print(Object)

print

void print(Collection<CharSequence> deferredContent)
           throws EngineException
Prints a list of text snippets to the request text output.

Parameters:
deferredContent - the text snippets that will be printed
Throws:
EngineException - if an error occurs during the output of the text snippets
Since:
1.1
See Also:
print(Template), print(Object)

print

void print(Object value)
           throws EngineException
Prints the string representation of an object to the request text output. The string representation will be created through a String.valueOf(value) call.

Parameters:
value - the object that will be output
Throws:
EngineException - if an error occurs during the output of the content
Since:
1.1
See Also:
print(Template), print(Collection)

clearBuffer

void clearBuffer()
Clears the text buffer is it's enabled.

If the text buffer is disabled, this method does nothing.

Since:
1.1

flush

void flush()
           throws EngineException
Forces all the streamed content to be output to the client.

If the text buffer is enabled, this will flush its content to the output stream first.

Throws:
EngineException
Since:
1.1

close

void close()
           throws EngineException
Closed the content output stream.

All content is flushed first.

Throws:
EngineException
Since:
1.1

getOutputStream

OutputStream getOutputStream()
                             throws EngineException
See ServletResponse.getOutputStream().

Throws:
EngineException
Since:
1.1

getWriter

PrintWriter getWriter()
                      throws IOException
See ServletResponse.getWriter().

Throws:
IOException
Since:
1.1

setContentType

void setContentType(String contentType)
See ServletResponse.setContentType(String).

Since:
1.1

isContentTypeSet

boolean isContentTypeSet()
Indicates whether this response's content type has been explicitly set.

Returns:
true if it has been set; or

false otherwise

Since:
1.3
See Also:
setContentType(java.lang.String)

getContentType

String getContentType()
Retrieves the content type that was explicitly set for this response.

Returns:
the content type as a String; or

null if the content type wasn't set

Since:
1.5.1
See Also:
setContentType(java.lang.String)

setLocale

void setLocale(Locale locale)
See ServletResponse.setLocale(Locale).

Since:
1.1

getLocale

Locale getLocale()
See ServletResponse.getLocale().

Since:
1.1

getCharacterEncoding

String getCharacterEncoding()
See ServletResponse.getCharacterEncoding().

Since:
1.1

setContentLength

void setContentLength(int length)
                      throws EngineException
See ServletResponse.setContentLength(int).

Throws:
EngineException
Since:
1.1

addCookie

void addCookie(Cookie cookie)
See HttpServletResponse.addCookie(Cookie).

Since:
1.1

addHeader

void addHeader(String name,
               String value)
See HttpServletResponse.addHeader(String, String).

Since:
1.1

addDateHeader

void addDateHeader(String name,
                   long date)
See HttpServletResponse.addDateHeader(String, long).

Since:
1.1

addIntHeader

void addIntHeader(String name,
                  int integer)
See HttpServletResponse.addIntHeader(String, int).

Since:
1.1

containsHeader

boolean containsHeader(String name)
See HttpServletResponse.containsHeader(String).

Since:
1.1

sendError

void sendError(int statusCode)
               throws EngineException
See HttpServletResponse.sendError(int).

Throws:
EngineException
Since:
1.1

sendError

void sendError(int statusCode,
               String message)
               throws EngineException
See HttpServletResponse.sendError(int, String).

Throws:
EngineException
Since:
1.1

sendRedirect

void sendRedirect(String location)
                  throws EngineException
See HttpServletResponse.sendRedirect(String).

Throws:
EngineException
Since:
1.1

setDateHeader

void setDateHeader(String name,
                   long date)
See HttpServletResponse.setDateHeader(String, long).

Since:
1.1

setHeader

void setHeader(String name,
               String value)
See HttpServletResponse.setHeader(String, String).

Since:
1.1

setIntHeader

void setIntHeader(String name,
                  int value)
See HttpServletResponse.setIntHeader(String, int).

Since:
1.1

setStatus

void setStatus(int statusCode)
See HttpServletResponse.setStatus(int).

Since:
1.1

encodeURL

String encodeURL(String url)
See HttpServletResponse.encodeURL(String).

Since:
1.1

getHttpServletResponse

HttpServletResponse getHttpServletResponse()
Retrieves the underlying HttpServletResponse.

Returns:
the underlying HttpServletResponse instance; or

null if this response isn't backed by HttpServletResponse

Since:
1.1


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.