java SAX½âÎöXMLÎļþ
import java.io.File;
import java.io.FileNotFoundException;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class ResolveXmlFile {
public void resolverXml() throws DocumentException, FileNotFoundException{
//¶ÁÈ¡xmlÎļþ À´µÃµ½document
SAXReader reader = new SAXReader();
Document document = reader.read(new File("F:\\Workspaces\\DomXmlProject\\src\\T_AR_OtherBillentry.xml"));
Element root = document.getRootElement();
//Ñ»·¸ù½Úµã
for(java.util.Iterator it =root.elementIterator("columns");it.hasNext();){
Element elm=(Element)it.next();
//Ñ»·×Ó½Úµã
for(java.util.Iterator it1 = elm.elementIterator("column");it1.hasNext();){
Element elm1 =(Element)it1.next();
Element name=elm1.element("name"); //È¡µÃ½Úµã
Element type=elm1.element("sqlType"); //È¡µÃ½Úµã
System.out.println(name.getData().toString()+type.getData().toString());
}
}
}
public static void main(String[] args) throws DocumentException, FileNotFoundException{
ResolveXmlFile rx = new ResolveXmlFile();
rx.resolverXml();
}
}
Ïà¹ØÎĵµ£º
import java.util.Timer;
import java.util.TimerTask;
public class EggTimer {
private final Timer timer = new Timer();
private final int minutes;
public EggT ......
6.·ºÐÍ:
1¡¢·ºÐ͵ÄÀàÐͲÎÊýÖ»ÄÜÊÇÀàÀàÐÍ£¨°üÀ¨×Ô¶¨ÒåÀࣩ£¬²»ÄÜÊǼòµ¥ÀàÐÍ¡£
¡¡¡¡2¡¢Í¬Ò»ÖÖ·ºÐÍ¿ÉÒÔ¶ÔÓ¦¶à¸ö°æ±¾£¨ÒòΪ²ÎÊýÀàÐÍÊDz»È·¶¨µÄ£©£¬²»Í¬°æ±¾µÄ·ºÐÍÀàʵÀýÊDz»¼æÈݵġ£
¡¡¡¡3¡¢·ºÐ͵ÄÀàÐͲÎÊý¿ÉÒÔÓжà¸ö¡£
¡¡¡¡4¡¢·ºÐ͵IJÎÊýÀàÐÍ¿ÉÒÔʹÓÃextendsÓï¾ä£¬ÀýÈç<T extends superclass>¡£Ï°¹ßÉϳÉΪ“Óн ......