001    /**
002     * Copyright (c) 2000-2013 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.portlet;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    import com.liferay.portal.kernel.xml.Element;
019    import com.liferay.portal.kernel.xml.QName;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class PortletQNameUtil {
025    
026            public static String getKey(QName qName) {
027                    return getPortletQName().getKey(qName);
028            }
029    
030            public static String getKey(String uri, String localPart) {
031                    return getPortletQName().getKey(uri, localPart);
032            }
033    
034            public static PortletQName getPortletQName() {
035                    PortalRuntimePermission.checkGetBeanProperty(PortletQNameUtil.class);
036    
037                    return _portletQName;
038            }
039    
040            public static String getPublicRenderParameterIdentifier(
041                    String publicRenderParameterName) {
042    
043                    return getPortletQName().getPublicRenderParameterIdentifier(
044                            publicRenderParameterName);
045            }
046    
047            public static String getPublicRenderParameterName(QName qName) {
048                    return getPortletQName().getPublicRenderParameterName(qName);
049            }
050    
051            public static QName getQName(
052                    Element qNameEl, Element nameEl, String defaultNamespace) {
053    
054                    return getPortletQName().getQName(qNameEl, nameEl, defaultNamespace);
055            }
056    
057            public static QName getQName(String publicRenderParameterName) {
058                    return getPortletQName().getQName(publicRenderParameterName);
059            }
060    
061            public static String getRemovePublicRenderParameterName(QName qName) {
062                    return getPortletQName().getRemovePublicRenderParameterName(qName);
063            }
064    
065            public static void setPublicRenderParameterIdentifier(
066                    String publicRenderParameterName, String identifier) {
067    
068                    getPortletQName().setPublicRenderParameterIdentifier(
069                            publicRenderParameterName, identifier);
070            }
071    
072            public void setPortletQName(PortletQName portletQName) {
073                    PortalRuntimePermission.checkSetBeanProperty(getClass());
074    
075                    _portletQName = portletQName;
076            }
077    
078            private static PortletQName _portletQName;
079    
080    }