1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet;
16  
17  import java.util.Collections;
18  import java.util.Enumeration;
19  import java.util.Map;
20  
21  import javax.portlet.PortletContext;
22  import javax.portlet.filter.FilterConfig;
23  
24  /**
25   * <a href="FilterConfigImpl.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Brian Wing Shun Chan
28   */
29  public class FilterConfigImpl implements FilterConfig {
30  
31      public FilterConfigImpl(
32          String filterName, PortletContext portletContext,
33          Map<String, String> params) {
34  
35          _filterName = filterName;
36          _portletContext = portletContext;
37          _params = params;
38      }
39  
40      public String getFilterName() {
41          return _filterName;
42      }
43  
44      public String getInitParameter(String name) {
45          if (name == null) {
46              throw new IllegalArgumentException();
47          }
48  
49          return _params.get(name);
50      }
51  
52      public Enumeration<String> getInitParameterNames() {
53          return Collections.enumeration(_params.keySet());
54      }
55  
56      public PortletContext getPortletContext() {
57          return _portletContext;
58      }
59  
60      private String _filterName;
61      private PortletContext _portletContext;
62      private Map<String, String> _params;
63  
64  }