Java XStream·â×°Àà
´Ë¸öÀàÊÇΪÁË·½±ã³õѧÕß¶ÔXMLµ½ javabean µÄÏ໥ת»»²»ÊìϤ¶øÐ´µÄ:
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
public class XmlBean {
/*
* @AUTHOR:ZHONG
* @CREATETIME:2010/02/10
* @PREAM:OBJECT(JAVABEAN)
* @RETURN:XML STRING
*/
public static String GenerateXML(Object model){
XStream xstream = new XStream(new DomDriver());
//ת»»³É xml ¸ñʽ
String xml = xstream.toXML(model);
return xml;
}
/*
* @AUTHOR:ZHONG
* @CREATETIME:2010/02/10
* @PREAM:STRING(XML)
* @RETURN:(javabean)OBJECT
*/
public static Object fromXML(String xmlString){
XStream xs = new XStream(new DomDriver());
Object ob = xs.fromXML(xmlString);
System.out.println(ob);
return ob;
}
ʹÓÃʵÀý:
public static void main(String[] args) {
UserBean user = new UserBean();
user.setUsername("zhongshulin");
user.setPassword("123456");
user.setEmail("zhong@shulin.com");
user.setPhone("123456789");
user.setAddress("Ö麣ƷÉÐ");
String xml = GenerateXML(user);
user =(UserBean)fromXML(xml);
String userName = user.getUsername();
String pass = user.getPassword();
String email = user.getEmail();
String phone = user.getPhone();
String address = user.getAddress();
}
Ïà¹ØÎĵµ£º
¢Ù¼Ì³ÐTimerTask£¬ÖØÐ´run·½·¨
package bamboo.task;
import java.util.TimerTask;
public class TimeTaskTest extends TimerTask{
@Override
public void run() {
System.out.println("hi");
}
}
¢Úͨ¹ýtimerÀ´ÉèÖÃij¸öʱ¼äÀ´µ÷Ó㬻òÕßÊÇÏà¸ô¶à³¤Ê±¼äµ÷ÓÃ
package bamboo.test;
......
JAVAµÄÐòÁл¯API£¬ËüÌṩÁËÒ»¸ö¿ò¼Ü£¬ÓÃÀ´½«¶ÔÏó±àÂë³ÉÒ»¸ö×Ö½ÚÁ÷£¬ÒÔ¼°´Ó×Ö½ÚÁ÷±àÂëÖÐÖØÐ¹¹½¨¶ÔÏó¡£½«Ò»¸ö¶ÔÏó±àÂë³ÉÒ»¸ö×Ö½ÚÁ÷£¬Õâ¸öÊÇÐòÁл¯¹ý³Ì£¬·´¹ýÀ´¾ÍÊÇ·¹ÐòÁл¯¡£Ò»µ©Ò»¸ö¶ÔÏó±»ÐòÁл¯ºó£¬ÔòËüµÄ±àÂë¿ÉÒÔ´ÓÒ»¸öÕýÔÚÔËÐеÄÐéÄâ»ú±»´«µÝµ½ÁíÍâÒ»¸öÐéÄâ»úÉÏ£¬»òÕß±»´æ´¢ÔÚ´ÅÅÌÉÏ£¬¹©ÒÔºó·´ÐòÁл¯Ê¹Óá£ÐòÁл¯¼¼ÊõÎªÔ ......
LADyRÊÇÎ÷°àÑÀÒ»¸öʵÑéÊÒÓиöweb extractionµÄÏîÄ¿ http://ladyr.es/index.php?id=75 µ±È»Õâ¸öÏîÄ¿»¹Ã»³öÀ´£¬²»¹ýÀïÃæÓиö½é
ÉÜÓÃjavaǶÈëä¯ÀÀÆ÷µÄ½Ì³Ì£¨http://ladyr.es/wiki/wiki/XPCOMGuide£©ºÜ²»´í¡£ËùÒÔ°ÑÕâÆªÎÄÕ·Òëһϣ¬Ë³±ã˵˵×Ô¼ºÑ§Ï°ÕâÆª
ÎÄÕÂÖµµÃ×¢ÒâµÄµØ·½¡£ËµÃ÷Ò»ÏÂÎÒʹÓõIJÙ×÷ϵͳÊÇwindows xp¡£ÏÂÃæ¶¼ ......
6 ¼ÓÔØÒ³ÃæµÄW3C DOM·ÃÎÊ
6.1 mozdom4java¿â
·ÃÎÊW3C DOMÊ÷±È·ÃÎÊMozillaµÄDOMÊ÷ÒªºÃ£¬ÒòΪËüÊÇÒ»¸ö¶¯Ì¬·ÃÎÊHTMLºÍXMLµÄDOMÊ÷µÄ±ê×¼¡£ÎªÁËʵÏÖÕâ¸ö£¬ÎÒÃÇʹÓôÓMozilla
DOMµ½W3C DOMµÄjava Bridge¡£ÓÐÒ»¸ö½Ð×ömozdom4javaµÄÏîÄ¿http://mozdom4java.mozdev.org/index.html¡£
ÏÂÔØÕâ¸ö°üºó£¬ÎÒÃǰÑjar°ü·Å ......
7.3 µã»÷ElementºÍÌîд±íµ¥
ÎÒÃÇ¿ÉÒÔ°²È«µÄ¼ÓÔØÒ³Ãæ£¬³éÈ¡ÐÅÏ¢£¬µ«ÊÇÓÐʱä¯ÀÀÍøÒ³ÊÇÐèÒªÌîд±íµ¥²¢Ìá½»»òÕßµã»÷ij¸öÔªËØÀ´´¥·¢onclickÒÔ±ãÖ´ÐÐÒ»¶Î
JavaScript´úÂë¡£
àÅ£¬ÒªÏëµã»÷Ò»¸öelementÐèÒª»ñµÃÕâ¸öelement(Ç°ÃæµÄxpathNodesÒ²Ðí¿ÉÒÔ°ïÎÒÃÇ×öµ½Õâµã)£¬Èç¹ûÊÇinput element£ ......