KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > context > portlet > RequestParameterMap


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.context.portlet;
17
18 import java.util.Enumeration JavaDoc;
19 import javax.portlet.PortletRequest;
20
21 import org.apache.myfaces.context.servlet.AbstractAttributeMap;
22
23 /**
24  * PortletRequest parameters as Map.
25  *
26  * @author Stan Silvert (latest modification by $Author: matzew $)
27  * @version $Revision: 1.1 $ $Date: 2005/01/26 17:03:09 $
28  * $Log: RequestParameterMap.java,v $
29  * Revision 1.1 2005/01/26 17:03:09 matzew
30  * MYFACES-86. portlet support provided by Stan Silver (JBoss Group)
31  *
32  */

33 public class RequestParameterMap extends AbstractAttributeMap
34 {
35     private final PortletRequest _portletRequest;
36
37     RequestParameterMap(PortletRequest portletRequest)
38     {
39         _portletRequest = portletRequest;
40     }
41
42     protected Object JavaDoc getAttribute(String JavaDoc key)
43     {
44         return _portletRequest.getParameter(key);
45     }
46
47     protected void setAttribute(String JavaDoc key, Object JavaDoc value)
48     {
49         throw new UnsupportedOperationException JavaDoc(
50             "Cannot set PortletRequest Parameter");
51     }
52
53     protected void removeAttribute(String JavaDoc key)
54     {
55         throw new UnsupportedOperationException JavaDoc(
56             "Cannot remove PortletRequest Parameter");
57     }
58
59     protected Enumeration JavaDoc getAttributeNames()
60     {
61         return _portletRequest.getParameterNames();
62     }
63 }
Popular Tags