KickJava   Java API By Example, From Geeks To Geeks.

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


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

36 public class InitParameterMap extends AbstractAttributeMap
37 {
38     final PortletContext _portletContext;
39
40     InitParameterMap(PortletContext portletContext)
41     {
42         _portletContext = portletContext;
43     }
44
45     protected Object JavaDoc getAttribute(String JavaDoc key)
46     {
47         return _portletContext.getInitParameter(key);
48     }
49
50     protected void setAttribute(String JavaDoc key, Object JavaDoc value)
51     {
52         throw new UnsupportedOperationException JavaDoc(
53             "Cannot set PortletContext InitParameter");
54     }
55
56     protected void removeAttribute(String JavaDoc key)
57     {
58         throw new UnsupportedOperationException JavaDoc(
59             "Cannot remove PortletContext InitParameter");
60     }
61
62     protected Enumeration JavaDoc getAttributeNames()
63     {
64         return _portletContext.getInitParameterNames();
65     }
66     
67     public boolean equals(Object JavaDoc o) {
68         boolean retValue;
69         
70         retValue = super.equals(o);
71         return retValue;
72     }
73     
74     public int hashCode() {
75         int retValue;
76         
77         retValue = super.hashCode();
78         return retValue;
79     }
80     
81 }
82
Popular Tags