⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 textutil.java

📁 webwork source
💻 JAVA
字号:
/*
* WebWork, Web Application Framework
*
* Distributable under Apache license.
* See terms of license at opensource.org
*/
package webwork.util;

/**
 * This class handles HTML escaping of text.
 * It was written and optimized to be as fast as possible.
 *
 * @author Dick Zetterberg (dick@transitor.se)
 * @version $Revision: 1.9 $
 */
public class TextUtil
{
	protected static final int MAX_LENGTH = 300;
	
	/**
	* We use arrays of char in the lookup table because it is faster
	* appending this to a StringBuffer than appending a String
	*/
	protected static final char[][] _stringChars = new char[MAX_LENGTH][];

	static
	{
		// Initialize the mapping table
		initMapping();
	}
	
	protected static void initMapping()
	{
		String[] strings = new String[MAX_LENGTH];

		addMapping(0x22, """, strings); // "
		addMapping(0x26, "&", strings); // &
		addMapping(0x3c, "&lt;", strings); // <
		addMapping(0x3e, "&gt;", strings); // >
		
		addMapping(0xa1, "&iexcl;", strings); // 
		addMapping(0xa2, "&cent;", strings); // 
		addMapping(0xa3, "&pound;", strings); // 
		addMapping(0xa9, "&copy;", strings); // 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -