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.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 BBCodeTranslator getBBCodeTranslator() {
026                    PortalRuntimePermission.checkGetBeanProperty(
027                            BBCodeTranslatorUtil.class);
028    
029                    return _bbCodeTranslator;
030            }
031    
032            public static String[] getEmoticonDescriptions() {
033                    return getBBCodeTranslator().getEmoticonDescriptions();
034            }
035    
036            public static String[] getEmoticonFiles() {
037                    return getBBCodeTranslator().getEmoticonFiles();
038            }
039    
040            public static String[][] getEmoticons() {
041                    return getBBCodeTranslator().getEmoticons();
042            }
043    
044            public static String[] getEmoticonSymbols() {
045                    return getBBCodeTranslator().getEmoticonSymbols();
046            }
047    
048            public static String getHTML(String bbcode) {
049                    return getBBCodeTranslator().getHTML(bbcode);
050            }
051    
052            public static String parse(String message) {
053                    return getBBCodeTranslator().parse(message);
054            }
055    
056            public void setBBCodeTranslator(BBCodeTranslator bbCodeTranslator) {
057                    PortalRuntimePermission.checkSetBeanProperty(getClass());
058    
059                    _bbCodeTranslator = bbCodeTranslator;
060            }
061    
062            private static BBCodeTranslator _bbCodeTranslator;
063    
064    }