001    /**
002     * Copyright (c) 2000-2012 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.parsers.bbcode;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    /**
020     * @author Iliyan Peychev
021     * @author Miguel Pastor
022     */
023    public class BBCodeTranslatorUtil {
024    
025            public static final String NEW_THREAD_URL = "${newThreadURL}";
026    
027            public static BBCodeTranslator getBBCodeTranslator() {
028                    PortalRuntimePermission.checkGetBeanProperty(
029                            BBCodeTranslatorUtil.class);
030    
031                    return _bbCodeTranslator;
032            }
033    
034            public static String[] getEmoticonDescriptions() {
035                    return getBBCodeTranslator().getEmoticonDescriptions();
036            }
037    
038            public static String[] getEmoticonFiles() {
039                    return getBBCodeTranslator().getEmoticonFiles();
040            }
041    
042            public static String[][] getEmoticons() {
043                    return getBBCodeTranslator().getEmoticons();
044            }
045    
046            public static String[] getEmoticonSymbols() {
047                    return getBBCodeTranslator().getEmoticonSymbols();
048            }
049    
050            public static String getHTML(String bbcode) {
051                    return getBBCodeTranslator().getHTML(bbcode);
052            }
053    
054            public static String parse(String message) {
055                    return getBBCodeTranslator().parse(message);
056            }
057    
058            public void setBBCodeTranslator(BBCodeTranslator bbCodeTranslator) {
059                    PortalRuntimePermission.checkSetBeanProperty(getClass());
060    
061                    _bbCodeTranslator = bbCodeTranslator;
062            }
063    
064            private static BBCodeTranslator _bbCodeTranslator;
065    
066    }