?? myhandler.java
字號(hào):
package zqs;
import javax.microedition.lcdui.Form;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
public class MyHandler extends DefaultHandler {
private Form form=null;
public MyHandler(Form _form)
{
form=_form;
form.deleteAll();
}
public void startDocument()throws SAXException
{
}
//
public void characters(char[]ch,int start,int length)throws SAXException
{
if(length!=0)
{
form.append(new String (ch,start,length));
}
}
//
public void startElement(String uri,String localName,String qName,Attributes attributes)throws SAXException
{
if(qName.equals("username")||qName.equals("email")||qName.equals("company"))
{
form.append(qName);
int len=attributes.getLength();
if(len>0)
{
form.append("(");
for(int i=0;i<len;i++)
{
form.append(attributes.getQName(i)+"="+attributes.getValue(i));
}
form.append(")");
}
form.append(":");
}
}
//
public void endElement(String uri ,String localName,String qName)throws SAXException
{
if(qName.equals("username")||qName.equals("email")||qName.equals("company"))
{
form.append("\n");
}
}
public void endDocument()throws SAXException
{
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -