myhandler.java

来自「一套大型Office网络办公系统」· Java 代码 · 共 53 行

JAVA
53
字号
/*** Copyright (c) 2002 CORPCN.com* All right reserved.** Description: ....** Author: Chu Daping 2002-6-16 13:57**/package com.corpcn.www;import org.xml.sax.*;import java.util.Hashtable;public class MyHandler extends HandlerBase{	private String myElement;	private String myValue; 	private Hashtable mytable;	public MyHandler()	{ 		myElement = null;		myValue = null;		mytable = new Hashtable();	}	public void characters(char ach[], int i, int j) throws SAXException	{		myValue = new String(ach, i, j);	}	public void endElement(String string) throws SAXException	{		if (myElement.equals(string))		{			mytable.put(myElement, myValue);		}    }	public Hashtable getTable()	{		return mytable;	}	public void startElement(String string, AttributeList attributeList) throws SAXException	{		myElement = string;	}}

⌨️ 快捷键说明

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