Weaver 3.1.0a1-D1

com.oldlight.weaver.interpreter
Class WeaverResponseContextImpl

java.lang.Object
  extended bycom.oldlight.weaver.interpreter.WeaverResponseContextImpl
All Implemented Interfaces:
WeaverResponseContext

public class WeaverResponseContextImpl
extends Object
implements WeaverResponseContext

Representation of a response to a request.

Author:
Paul Harvey

Field Summary
private  HttpServletResponse response
           
 
Constructor Summary
WeaverResponseContextImpl(HttpServletResponse response)
          Create a new reponse object.
 
Method Summary
 void addDateHeader(String name, long date)
          Add a named date header.
 void addIntHeader(String name, int value)
          Add a named integer header.
 void addStringHeader(String name, String value)
          Add a named string header.
 void setCharacterEncoding(String charset)
          Set the character encoding of the response.
 void setContentLength(int length)
          Set the lenght of the response.
 void setContentType(String mimeType)
          Set the content type (MIME type) of the response.
 void setDateHeader(String name, long date)
          Set a date header in the response.
 void setHeader(String name, String value)
          Set a header in the response.
 void setIntHeader(String name, int value)
          Set an integer header in the response.
 void setLocale(Locale locale)
          Set the locale of the response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

response

private HttpServletResponse response
Constructor Detail

WeaverResponseContextImpl

public WeaverResponseContextImpl(HttpServletResponse response)
Create a new reponse object.

Parameters:
response - The servlet response object to wrap.
Method Detail

setHeader

public void setHeader(String name,
                      String value)
Set a header in the response.

Specified by:
setHeader in interface WeaverResponseContext
Parameters:
name - The name of the header to set.
value - The value to set the header to.

setDateHeader

public void setDateHeader(String name,
                          long date)
Set a date header in the response.

Specified by:
setDateHeader in interface WeaverResponseContext
Parameters:
name - The name of the header to set.
date - Number of milliseconds since 1st Jan 1970.

setIntHeader

public void setIntHeader(String name,
                         int value)
Set an integer header in the response.

Specified by:
setIntHeader in interface WeaverResponseContext
Parameters:
name - The name of the header to set.
value - The value to set the header to.

addDateHeader

public void addDateHeader(String name,
                          long date)
Add a named date header.

Specified by:
addDateHeader in interface WeaverResponseContext
Parameters:
name - The name of the header to add.
date - Number of milliseconds since 1st Jan 1970.

addIntHeader

public void addIntHeader(String name,
                         int value)
Add a named integer header.

Specified by:
addIntHeader in interface WeaverResponseContext
Parameters:
name - The name of the header to add.
value - Number of millseconds since 1st Jan 1970.

addStringHeader

public void addStringHeader(String name,
                            String value)
Add a named string header.

Specified by:
addStringHeader in interface WeaverResponseContext
Parameters:
name - The name of the header to add.
value - The value of the header to add.

setContentType

public void setContentType(String mimeType)
Set the content type (MIME type) of the response.

Specified by:
setContentType in interface WeaverResponseContext
Parameters:
mimeType - MIME type of the response.

setCharacterEncoding

public void setCharacterEncoding(String charset)
Set the character encoding of the response.

Specified by:
setCharacterEncoding in interface WeaverResponseContext
Parameters:
charset - Character encoding of the response.

setLocale

public void setLocale(Locale locale)
Set the locale of the response.

Specified by:
setLocale in interface WeaverResponseContext
Parameters:
locale - Locale of the response.

setContentLength

public void setContentLength(int length)
Set the lenght of the response.

Specified by:
setContentLength in interface WeaverResponseContext
Parameters:
length - Length of the response.

Copyright ©Paul Harvey