1 9 package org.jboss.portal.portlet.impl; 10 11 import java.util.Collections ; 12 import java.util.Enumeration ; 13 import java.util.Locale ; 14 import java.util.Map ; 15 import java.util.ResourceBundle ; 16 17 import javax.portlet.PortletConfig; 18 import javax.portlet.PortletContext; 19 20 import org.jboss.portal.portlet.plugins.language.ResourceBundles; 21 22 26 public class PortletConfigImpl implements PortletConfig 27 { 28 29 private String portletName; 30 private PortletContext portletContext; 31 private Map initParameters; 32 private ResourceBundles resourceBundles; 33 34 public PortletConfigImpl(String portletName, 35 PortletContext portletContext, 36 Map initParameters, 37 ResourceBundles resourceBundles) 38 { 39 this.portletName = portletName; 40 this.portletContext = portletContext; 41 this.initParameters = initParameters; 42 this.resourceBundles = resourceBundles; 43 } 44 45 public String getPortletName() 46 { 47 return portletName; 48 } 49 50 public PortletContext getPortletContext() 51 { 52 return portletContext; 53 } 54 55 59 public ResourceBundle getResourceBundle(Locale locale) 60 { 61 return resourceBundles.get(locale); 62 } 63 64 public String getInitParameter(String s) 65 { 66 if (s == null) 67 { 68 throw new IllegalArgumentException ("name must not be null"); 69 } 70 return (String )initParameters.get(s); 71 } 72 73 public Enumeration getInitParameterNames() 74 { 75 return Collections.enumeration(initParameters.keySet()); 76 } 77 } 78 | Popular Tags |