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.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    }