net.wotonomy.web
Class WOMessage

java.lang.Object
  extended by net.wotonomy.web.WOMessage
Direct Known Subclasses:
WOResponse

public class WOMessage
extends java.lang.Object

A pure java implementation of WOResponse.

Version:
$Revision: 905 $
Author:
ezamudio@nasoft.com, $Author: cgruber $

Field Summary
protected  net.wotonomy.foundation.NSMutableData _contentData
           
protected  java.lang.String _contentEncoding
           
protected  net.wotonomy.foundation.NSMutableDictionary _cookies
           
protected  net.wotonomy.foundation.NSMutableDictionary _headers
           
 
Constructor Summary
WOMessage()
           
 
Method Summary
 void addCookie(WOCookie aCookie)
          Adds the specified cookie to the response.
 void appendContentCharacter(char character)
          Appends the specified byte to the response.
 void appendContentData(net.wotonomy.foundation.NSData aData)
          Appends the bytes in the specified data object to the response.
 void appendContentHTMLAttributeValue(java.lang.String aString)
          Appends the specified string containing HTML to the response.
 void appendContentHTMLString(java.lang.String aString)
          Appends the specified string containing HTML to the response.
 void appendContentString(java.lang.String aString)
          Appends the specified string to the response.
 net.wotonomy.foundation.NSData content()
          Retrieves the current content of the response.
 java.lang.String contentEncoding()
          Gets the current content encoding for the response.
 net.wotonomy.foundation.NSArray cookies()
          Returns an array of cookies currently being sent with the response.
 java.lang.String headerForKey(java.lang.String aKey)
          Returns one header value for the specified key.
 net.wotonomy.foundation.NSArray headerKeys()
          Returns an array of all the header keys that have been set in the response.
 net.wotonomy.foundation.NSArray headersForKey(java.lang.String aKey)
          Returns an array of all the header values for the specified key, or null if the key does not exist.
 java.lang.String httpVersion()
          Gets the current HTTP version header for the response.
 void removeCookie(WOCookie aCookie)
          Removes the specified cookie from the response.
 void setContent(net.wotonomy.foundation.NSData aData)
          Sets the content of the response to the bytes represented by the specified data object.
 void setContentEncoding(java.lang.String encoding)
          Sets the content encoding for the response.
 void setHeader(java.lang.String aValue, java.lang.String aKey)
          Sets the specified header value for the specified key.
 void setHeaders(net.wotonomy.foundation.NSArray headerArray, java.lang.String aKey)
          Sets the specified array of values as headers under the specified key.
 void setHTTPVersion(java.lang.String aString)
          Sets the HTTP version header in the response.
 void setUserInfo(net.wotonomy.foundation.NSDictionary aDict)
          Sets the current user info dictionary.
static java.lang.String stringByEscapingHTMLAttributeValue(java.lang.String aString)
          Returns a sting containing the contents of the specified string after escaping all special HTML characters.
static java.lang.String stringByEscapingHTMLString(java.lang.String aString)
          Returns a sting containing the contents of the specified string after escaping all special HTML characters.
 net.wotonomy.foundation.NSDictionary userInfo()
          Gets the current user info dictionary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_contentEncoding

protected java.lang.String _contentEncoding

_headers

protected net.wotonomy.foundation.NSMutableDictionary _headers

_cookies

protected net.wotonomy.foundation.NSMutableDictionary _cookies

_contentData

protected net.wotonomy.foundation.NSMutableData _contentData
Constructor Detail

WOMessage

public WOMessage()
Method Detail

setContentEncoding

public void setContentEncoding(java.lang.String encoding)
Sets the content encoding for the response.


contentEncoding

public java.lang.String contentEncoding()
Gets the current content encoding for the response.


setHeaders

public void setHeaders(net.wotonomy.foundation.NSArray headerArray,
                       java.lang.String aKey)
Sets the specified array of values as headers under the specified key.


setHeader

public void setHeader(java.lang.String aValue,
                      java.lang.String aKey)
Sets the specified header value for the specified key.


headerKeys

public net.wotonomy.foundation.NSArray headerKeys()
Returns an array of all the header keys that have been set in the response.


headersForKey

public net.wotonomy.foundation.NSArray headersForKey(java.lang.String aKey)
Returns an array of all the header values for the specified key, or null if the key does not exist.


headerForKey

public java.lang.String headerForKey(java.lang.String aKey)
Returns one header value for the specified key. Provided as a convenience, since most header keys will have a single value.


setContent

public void setContent(net.wotonomy.foundation.NSData aData)
Sets the content of the response to the bytes represented by the specified data object.


content

public net.wotonomy.foundation.NSData content()
Retrieves the current content of the response.


setUserInfo

public void setUserInfo(net.wotonomy.foundation.NSDictionary aDict)
Sets the current user info dictionary. These values are for application-specific uses and are available to other actions and components in the request-response cycle.


userInfo

public net.wotonomy.foundation.NSDictionary userInfo()
Gets the current user info dictionary. These values are for application-specific uses are are available to other actions and components in the request-response cycle.


appendContentData

public void appendContentData(net.wotonomy.foundation.NSData aData)
Appends the bytes in the specified data object to the response.


appendContentCharacter

public void appendContentCharacter(char character)
Appends the specified byte to the response.


appendContentString

public void appendContentString(java.lang.String aString)
Appends the specified string to the response. Any special characters will not be escaped. The string will be encoded in the current content encoding.


appendContentHTMLString

public void appendContentHTMLString(java.lang.String aString)
Appends the specified string containing HTML to the response. Any special characters will be escaped appropriately. The string will be encoded in the current content encoding.


appendContentHTMLAttributeValue

public void appendContentHTMLAttributeValue(java.lang.String aString)
Appends the specified string containing HTML to the response. Any special characters will be escaped appropriately. This method escapes tabs and new-line characters as well. The string will be encoded in the current content encoding.


addCookie

public void addCookie(WOCookie aCookie)
Adds the specified cookie to the response.


removeCookie

public void removeCookie(WOCookie aCookie)
Removes the specified cookie from the response.


cookies

public net.wotonomy.foundation.NSArray cookies()
Returns an array of cookies currently being sent with the response. Contains whatever cookies have previously been set in this response.


setHTTPVersion

public void setHTTPVersion(java.lang.String aString)
Sets the HTTP version header in the response.


httpVersion

public java.lang.String httpVersion()
Gets the current HTTP version header for the response. Because servlet responses do not allow read access to headers, this method returns null if setHTTPVersion has not been called.


stringByEscapingHTMLString

public static java.lang.String stringByEscapingHTMLString(java.lang.String aString)
Returns a sting containing the contents of the specified string after escaping all special HTML characters.


stringByEscapingHTMLAttributeValue

public static java.lang.String stringByEscapingHTMLAttributeValue(java.lang.String aString)
Returns a sting containing the contents of the specified string after escaping all special HTML characters. This method escapes tabs and new-line characters as well.



Copyright © 2006 null. All Rights Reserved.