001    /**
002     * Copyright (c) 2000-2012 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.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    }