Package webwork.util
Class TextUtil
java.lang.Object
webwork.util.TextUtil
This class handles HTML escaping of text. It was written and optimized to be as fast as possible.
- Version:
- $Revision: 1.9 $
- Author:
- Dick Zetterberg (dick@transitor.se)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final char[][]We use arrays of char in the lookup table because it is faster appending this to a StringBuffer than appending a Stringprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddMapping(int c, String txt, String[] strings) static final StringescapeHTML(String s) Call escapeHTML(s, false)static final StringescapeHTML(String s, boolean escapeEmpty) Escape HTML.protected static void
-
Field Details
-
MAX_LENGTH
protected static final int MAX_LENGTH- See Also:
-
_stringChars
protected static final char[][] _stringCharsWe use arrays of char in the lookup table because it is faster appending this to a StringBuffer than appending a String
-
-
Constructor Details
-
TextUtil
public TextUtil()
-
-
Method Details
-
initMapping
protected static void initMapping() -
addMapping
-
escapeHTML
Call escapeHTML(s, false) -
escapeHTML
Escape HTML.- Parameters:
s- string to be escapedescapeEmpty- if true, then empty string will be escaped.
-