| FilterConfigImpl.java |
1 /**
2 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
7 * any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
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 }