001    /**
002     * Copyright (c) 2000-2010 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.util;
016    
017    /**
018     * @author Brian Wing Shun Chan
019     * @author Clarence Shen
020     * @author Harry Mark
021     * @author Samuel Kong
022     */
023    public class HtmlUtil {
024    
025            public static String escape(String html) {
026                    return getHtml().escape(html);
027            }
028    
029            public static String escape(String html, int mode) {
030                    return getHtml().escape(html, mode);
031            }
032    
033            public static String escapeAttribute(String attribute) {
034                    return getHtml().escapeAttribute(attribute);
035            }
036    
037            public static String escapeCSS(String css) {
038                    return getHtml().escapeCSS(css);
039            }
040    
041            public static String escapeHREF(String href) {
042                    return getHtml().escapeHREF(href);
043            }
044    
045            public static String escapeJS(String js) {
046                    return getHtml().escapeJS(js);
047            }
048    
049            public static String escapeURL(String url) {
050                    return getHtml().escapeURL(url);
051            }
052    
053            public static String extractText(String html) {
054                    return getHtml().extractText(html);
055            }
056    
057            public static String fromInputSafe(String html) {
058                    return getHtml().fromInputSafe(html);
059            }
060    
061            public static Html getHtml() {
062                    return _html;
063            }
064    
065            public static String replaceMsWordCharacters(String html) {
066                    return getHtml().replaceMsWordCharacters(html);
067            }
068    
069            public static String stripBetween(String html, String tag) {
070                    return getHtml().stripBetween(html, tag);
071            }
072    
073            public static String stripComments(String html) {
074                    return getHtml().stripComments(html);
075            }
076    
077            public static String stripHtml(String html) {
078                    return getHtml().stripHtml(html);
079            }
080    
081            public static String toInputSafe(String html) {
082                    return getHtml().toInputSafe(html);
083            }
084    
085            public static String unescape(String html) {
086                    return getHtml().unescape(html);
087            }
088    
089            public static String wordBreak(String html, int columns) {
090                    return getHtml().wordBreak(html, columns);
091            }
092    
093            public void setHtml(Html html) {
094                    _html = html;
095            }
096    
097            private static Html _html;
098    
099    }