KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > context > servlet > 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 package org.apache.myfaces.context.servlet;
17
18 import java.util.Enumeration JavaDoc;
19
20 import javax.servlet.ServletContext JavaDoc;
21
22
23 /**
24  * ServletContext init parameters as Map.
25  *
26  * @author Anton Koinov (latest modification by $Author: matze $)
27  * @version $Revision: 1.9 $ $Date: 2004/10/13 11:51:00 $
28  */

29 public class InitParameterMap extends AbstractAttributeMap
30 {
31     final ServletContext JavaDoc _servletContext;
32
33     InitParameterMap(ServletContext JavaDoc servletContext)
34     {
35         _servletContext = servletContext;
36     }
37
38     protected Object JavaDoc getAttribute(String JavaDoc key)
39     {
40         return _servletContext.getInitParameter(key);
41     }
42
43     protected void setAttribute(String JavaDoc key, Object JavaDoc value)
44     {
45         throw new UnsupportedOperationException JavaDoc(
46             "Cannot set ServletContext InitParameter");
47     }
48
49     protected void removeAttribute(String JavaDoc key)
50     {
51         throw new UnsupportedOperationException JavaDoc(
52             "Cannot remove ServletContext InitParameter");
53     }
54
55     protected Enumeration JavaDoc getAttributeNames()
56     {
57         return _servletContext.getInitParameterNames();
58     }
59 }
60
Popular Tags