1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.util;
16  
17  /**
18   * <a href="HtmlUtil.java.html"><b><i>View Source</i></b></a>
19   *
20   * @author Brian Wing Shun Chan
21   * @author Clarence Shen
22   * @author Harry Mark
23   * @author Samuel Kong
24   */
25  public class HtmlUtil {
26  
27      public static String escape(String html) {
28          return getHtml().escape(html);
29      }
30  
31      public static String escape(String html, int mode) {
32          return getHtml().escape(html, mode);
33      }
34  
35      public static String escapeAttribute(String attribute) {
36          return getHtml().escapeAttribute(attribute);
37      }
38  
39      public static String escapeCSS(String css) {
40          return getHtml().escapeCSS(css);
41      }
42  
43      public static String escapeJS(String js) {
44          return getHtml().escapeJS(js);
45      }
46  
47      public static String escapeURL(String url) {
48          return getHtml().escapeURL(url);
49      }
50  
51      public static String extractText(String html) {
52          return getHtml().extractText(html);
53      }
54  
55      public static String fromInputSafe(String html) {
56          return getHtml().fromInputSafe(html);
57      }
58  
59      public static Html getHtml() {
60          return _html;
61      }
62  
63      public static String replaceMsWordCharacters(String html) {
64          return getHtml().replaceMsWordCharacters(html);
65      }
66  
67      public static String stripBetween(String html, String tag) {
68          return getHtml().stripBetween(html, tag);
69      }
70  
71      public static String stripComments(String html) {
72          return getHtml().stripComments(html);
73      }
74  
75      public static String stripHtml(String html) {
76          return getHtml().stripHtml(html);
77      }
78  
79      public static String toInputSafe(String html) {
80          return getHtml().toInputSafe(html);
81      }
82  
83      public static String unescape(String html) {
84          return getHtml().unescape(html);
85      }
86  
87      public void setHtml(Html html) {
88          _html = html;
89      }
90  
91      private static Html _html;
92  
93  }