001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.portlet;
016    
017    import java.io.IOException;
018    import java.io.Writer;
019    
020    import java.util.Map;
021    
022    import javax.portlet.PortletMode;
023    import javax.portlet.PortletModeException;
024    import javax.portlet.PortletSecurityException;
025    import javax.portlet.PortletURL;
026    import javax.portlet.WindowState;
027    import javax.portlet.WindowStateException;
028    
029    /**
030     * @author Brian Wing Shun Chan
031     */
032    public class PortletURLWrapper implements PortletURL {
033    
034            public PortletURLWrapper(PortletURL portletURL) {
035                    _portletURL = portletURL;
036            }
037    
038            public void addProperty(String key, String value) {
039                    _portletURL.addProperty(key, value);
040            }
041    
042            public Map<String, String[]> getParameterMap() {
043                    return _portletURL.getParameterMap();
044            }
045    
046            public PortletMode getPortletMode() {
047                    return _portletURL.getPortletMode();
048            }
049    
050            public WindowState getWindowState() {
051                    return _portletURL.getWindowState();
052            }
053    
054            public void removePublicRenderParameter(String name) {
055                    _portletURL.removePublicRenderParameter(name);
056            }
057    
058            public void setParameter(String name, String value) {
059                    _portletURL.setParameter(name, value);
060            }
061    
062            public void setParameter(String name, String[] values) {
063                    _portletURL.setParameter(name, values);
064            }
065    
066            public void setParameters(Map<String, String[]> parameters) {
067                    _portletURL.setParameters(parameters);
068            }
069    
070            public void setPortletMode(PortletMode portletMode)
071                    throws PortletModeException{
072    
073                    _portletURL.setPortletMode(portletMode);
074            }
075    
076            public void setProperty(String key, String value) {
077                    _portletURL.setProperty(key, value);
078            }
079    
080            public void setSecure(boolean secure) throws PortletSecurityException {
081                    _portletURL.setSecure(secure);
082            }
083    
084            public void setWindowState(WindowState windowState)
085                    throws WindowStateException {
086    
087                    _portletURL.setWindowState(windowState);
088            }
089    
090            public String toString() {
091                    return _portletURL.toString();
092            }
093    
094            public void write(Writer writer) throws IOException {
095                    _portletURL.write(writer);
096            }
097    
098            public void write(Writer writer, boolean escapeXML) throws IOException {
099                    _portletURL.write(writer, escapeXML);
100            }
101    
102            private PortletURL _portletURL;
103    
104    }