001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.template;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.util.List;
020    
021    /**
022     * @author Juan Fern??ndez
023     */
024    public class TemplateHandlerRegistryUtil {
025    
026            public static long[] getClassNameIds() {
027                    return getTemplateRegistry().getClassNameIds();
028            }
029    
030            public static TemplateHandler getTemplateHandler(long classNameId) {
031                    return getTemplateRegistry().getTemplateHandler(classNameId);
032            }
033    
034            public static TemplateHandler getTemplateHandler(String className) {
035                    return getTemplateRegistry().getTemplateHandler(className);
036            }
037    
038            public static List<TemplateHandler> getTemplateHandlers() {
039                    return getTemplateRegistry().getTemplateHandlers();
040            }
041    
042            public static TemplateHandlerRegistry getTemplateRegistry() {
043                    PortalRuntimePermission.checkGetBeanProperty(
044                            TemplateHandlerRegistryUtil.class);
045    
046                    return _templateHandlerRegistry;
047            }
048    
049            public static void register(TemplateHandler templateHandler) {
050                    getTemplateRegistry().register(templateHandler);
051            }
052    
053            public static void unregister(TemplateHandler templateHandler) {
054                    getTemplateRegistry().unregister(templateHandler);
055            }
056    
057            public void setTemplateHandlerRegistry(
058                    TemplateHandlerRegistry templateHandlerRegistry) {
059    
060                    PortalRuntimePermission.checkSetBeanProperty(getClass());
061    
062                    _templateHandlerRegistry = templateHandlerRegistry;
063            }
064    
065            private static TemplateHandlerRegistry _templateHandlerRegistry;
066    
067    }