org.apache.wicket.response
Class StringResponse

java.lang.Object
  extended by org.apache.wicket.request.Response
      extended by org.apache.wicket.response.StringResponse

public class StringResponse
extends Response

Response object that writes to a StringWriter. If the StringResponse is later converted to a String via toString(), the output which was written to the StringResponse will be returned as a String.

Author:
Jonathan Locke

Field Summary
protected  AppendingStringBuffer out
          StringWriter to write to
 
Constructor Summary
StringResponse()
          Constructor
 
Method Summary
 java.lang.String encodeURL(java.lang.CharSequence url)
          Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
 java.lang.CharSequence getBuffer()
           
 java.lang.Object getContainerResponse()
          Provides access to the low-level container response object that implementaion of this Response delegate to.
 void reset()
          Called when the Response needs to reset itself.
 java.lang.String toString()
           
 void write(byte[] array)
          Writes the buffer to output.
 void write(java.lang.CharSequence string)
          Writes the CharSequence to output.
 
Methods inherited from class org.apache.wicket.request.Response
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

out

protected final AppendingStringBuffer out
StringWriter to write to

Constructor Detail

StringResponse

public StringResponse()
Constructor

Method Detail

write

public void write(java.lang.CharSequence string)
Description copied from class: Response
Writes the CharSequence to output.

Specified by:
write in class Response
See Also:
Response.write(CharSequence)

reset

public void reset()
Description copied from class: Response
Called when the Response needs to reset itself. Subclasses can empty there buffer or build up state.

Overrides:
reset in class Response
See Also:
Response.reset()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getBuffer

public java.lang.CharSequence getBuffer()
Returns:
The internal buffer directly as a CharSequence

write

public void write(byte[] array)
Description copied from class: Response
Writes the buffer to output.

Specified by:
write in class Response
See Also:
org.apache.wicket.request.Response#getOutputStream()

encodeURL

public java.lang.String encodeURL(java.lang.CharSequence url)
Description copied from class: Response
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.

Specified by:
encodeURL in class Response
Returns:
encoded URL

getContainerResponse

public java.lang.Object getContainerResponse()
Description copied from class: Response
Provides access to the low-level container response object that implementaion of this Response delegate to. This allows users to access features provided by the container response but not by generalized Wicket Response objects.

Specified by:
getContainerResponse in class Response
Returns:
low-level container response object, or null if none


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.