KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > state > cocoon > ResponseScope


1 package org.sapia.soto.state.cocoon;
2
3 import org.apache.cocoon.environment.Response;
4
5 import org.sapia.soto.state.Scope;
6
7
8 /**
9  * Implements the <code>Scope</code> interface over a Cocoon <code>Response</code>.
10  *
11  * @author Yanick Duchesne
12  * <dl>
13  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
14  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
15  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
16  * </dl>
17  */

18 public class ResponseScope implements Scope {
19   private Response _resp;
20
21   public ResponseScope(Response resp) {
22     _resp = resp;
23   }
24
25   /**
26    * @see org.sapia.soto.state.Scope#getVal(java.lang.Object)
27    */

28   public Object JavaDoc getVal(Object JavaDoc key) {
29     return null;
30   }
31
32   /**
33    * @see org.sapia.soto.state.Scope#putVal(java.lang.Object, java.lang.Object)
34    */

35   public void putVal(Object JavaDoc key, Object JavaDoc value) {
36     _resp.setHeader(key.toString(), value.toString());
37   }
38
39   /**
40    * @return the <code>Response</code> that this instance wraps.
41    */

42   public Response getResponse() {
43     return _resp;
44   }
45 }
46
Popular Tags