public class

TextUtil

extends Object
java.lang.Object
   ↳ webwork.util.TextUtil

Class Overview

This class handles HTML escaping of text. It was written and optimized to be as fast as possible.

Summary

Constants
int MAX_LENGTH
Fields
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
Public Constructors
TextUtil()
Public Methods
final static String escapeHTML(String s, boolean escapeEmpty)
Escape HTML.
final static String escapeHTML(String s)
Call escapeHTML(s, false)
Protected Methods
static void addMapping(int c, String txt, String[] strings)
static void initMapping()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

protected static final int MAX_LENGTH

Constant Value: 300 (0x0000012c)

Fields

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

Public Constructors

public TextUtil ()

Public Methods

public static final String escapeHTML (String s, boolean escapeEmpty)

Escape HTML.

Parameters
s string to be escaped
escapeEmpty if true, then empty string will be escaped.

public static final String escapeHTML (String s)

Call escapeHTML(s, false)

Protected Methods

protected static void addMapping (int c, String txt, String[] strings)

protected static void initMapping ()