org.apache.struts2.views.util
Class TextUtil
java.lang.Object
org.apache.struts2.views.util.TextUtil
public class TextUtil
- extends Object
This class handles HTML escaping of text.
It was written and optimized to be as fast as possible.
Field Summary |
protected static char[][] |
_stringChars
We use arrays of char in the lookup table because it is faster
appending this to a StringBuffer than appending a String |
protected static int |
MAX_LENGTH
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_LENGTH
protected static final int MAX_LENGTH
- See Also:
- Constant Field Values
_stringChars
protected static final char[][] _stringChars
- We use arrays of char in the lookup table because it is faster
appending this to a StringBuffer than appending a String
TextUtil
public TextUtil()
escapeHTML
public static final String escapeHTML(String s)
- Call escapeHTML(s, false)
escapeHTML
public static final String escapeHTML(String s,
boolean escapeEmpty)
- Escape HTML.
- Parameters:
s
- string to be escapedescapeEmpty
- if true, then empty string will be escaped.
addMapping
protected static void addMapping(int c,
String txt,
String[] strings)
initMapping
protected static void initMapping()
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.