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.portal.kernel.javadoc;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.lang.reflect.Method;
020    
021    /**
022     * @author Igor Spasic
023     */
024    public class JavadocManagerUtil {
025    
026            public static JavadocManager getJavadocManager() {
027                    PortalRuntimePermission.checkGetBeanProperty(JavadocManagerUtil.class);
028    
029                    return _javadocManager;
030            }
031    
032            public static void load(
033                    String servletContextName, ClassLoader classLoader) {
034    
035                    getJavadocManager().load(servletContextName, classLoader);
036            }
037    
038            public static JavadocClass lookupJavadocClass(Class<?> clazz) {
039                    return getJavadocManager().lookupJavadocClass(clazz);
040            }
041    
042            public static JavadocMethod lookupJavadocMethod(Method method) {
043                    return getJavadocManager().lookupJavadocMethod(method);
044            }
045    
046            public static void unload(String servletContextName) {
047                    getJavadocManager().unload(servletContextName);
048            }
049    
050            public void setJavadocManager(JavadocManager javadocManager) {
051                    PortalRuntimePermission.checkSetBeanProperty(getClass());
052    
053                    _javadocManager = javadocManager;
054            }
055    
056            private static JavadocManager _javadocManager;
057    
058    }