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();
}
}
Ïà¹ØÎĵµ£º
¸Õ¸Õ¿´µ½Ò»ÆªÎÄÕÂÌá³öc++¶à̬Óëjava¶à̬²»Í¬µÄµØ·½£¬»ù±¾Òâ˼ÈçÏ£º
Çë¿´C++´úÂ룺
class Base
{
public:
Base()
{
init();
}
virtual ~Base() {}
protected:
int value;
virtual void init()
{
value = 100; &nb ......
1.¾²Ì¬µ¼È룺
¾²Ì¬µ¼ÈëÊÇJDK1.5ºóмӵŦÄÜ£¬Ò»°ã²»Ôõô³£Ó㬺ܼòµ¥¸øÄã¾Ù¸öÀý×ÓÄã¾ÍÄÜÃ÷°×ÁË£¬¿´Õâ¶Î´úÂ룺
import static java.lang.System.out;//µ¼Èëjava.lang°üϵÄSystemÀàµÄ¾²Ì¬·½·¨out;
public class HelloWorld{
public static void main(String[] args){
out.print("Hello World!");//¼ÈÊÇÔÚÕ ......
¡¾IT168 Îĵµ
¡¿ÄÚ´æ
й¶ÎÊÌâ¶ÔÓÚ³ÌÐòÀ´Ëµ£¬ÊÇÒ»¸öºÜÄÑ·¢ÏÖ£¬²¢ÇÒÈÝÒ×ÒýÆðÑÏÖØÔÖº¦µÄÊÂÇé¡£
JavaÒ»Ö±ÒÔÆäÀ¬»ø»ØÊÕ»úÖÆΪ×ÔºÀ£¬ÄÇÊÇ·ñÕâÖÖ»úÖƾÍÊÇÍêÃÀµÄÄØ¡£
¡¡¡¡³£¹æÀí½âÉÏ£¬JavaµÄÄÚ´æ
¹ÜÀí»úÖÆÊǽ«¾Ö²¿±äÁ¿±£´æÔÚ¶ÑÖУ¬µ±±äÁ¿µÄ×÷ÓÃÓò½áÊøÖ®ºó£¬¸Ã±äÁ¿ËùÕ¼ÓõÄ
ÄÚÈݻᱻ×Ô¶¯»ØÊÕ¡£²»ÐèÒª×öÈκÎÌØÊâµÄ´¦Àí¡£±ÈÈçÏ ......
6.·ºÐÍ:
1¡¢·ºÐ͵ÄÀàÐͲÎÊýÖ»ÄÜÊÇÀàÀàÐÍ£¨°üÀ¨×Ô¶¨ÒåÀࣩ£¬²»ÄÜÊǼòµ¥ÀàÐÍ¡£
¡¡¡¡2¡¢Í¬Ò»ÖÖ·ºÐÍ¿ÉÒÔ¶ÔÓ¦¶à¸ö°æ±¾£¨ÒòΪ²ÎÊýÀàÐÍÊDz»È·¶¨µÄ£©£¬²»Í¬°æ±¾µÄ·ºÐÍÀàʵÀýÊDz»¼æÈݵġ£
¡¡¡¡3¡¢·ºÐ͵ÄÀàÐͲÎÊý¿ÉÒÔÓжà¸ö¡£
¡¡¡¡4¡¢·ºÐ͵IJÎÊýÀàÐÍ¿ÉÒÔʹÓÃextendsÓï¾ä£¬ÀýÈç<T extends superclass>¡£Ï°¹ßÉϳÉΪ“Óн ......