javaÖÐorg.apache.commons.digesterÀàÓ÷¨
xmlÎļþÄÚÈÝ£º
<?xml version="1.0" encoding="UTF-8"?>
<channels>
<channel switchTime="20080101000101" k="1.07" n="6" s="55" channelId="0404" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0405" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0406" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0407" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0408" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0409" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0433" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0434" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0437" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0435" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0438" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0439" channelName="xxxx.xxxx.xxx.cn"/>
<channel switchTime="20080301010101" k="1.07" n="6" s="55" channelId="0440" channelName="xxxx.xxxx.xxx.cn"/>
</channels>
import org.apache.commons.digester.Digester;
Digester digester = new Digester();
//´Ë·½·¨×÷ÓÃÊÇÊÇ·ñ¶ÔXMLÎĵµ½øÐÐDTDÑéÖ¤
digester.setValidating(false);
//addObjectCreateµÄ×÷ÓÃÊÇ£ºµ±Óö¼ûchannelsÔªËصÄʱºò£¬²úÉúÒ»¸öjava.util.ArrayList¶ÔÏó
digester.addObjectCreate("channels", "java.util.ArrayList");
//addSetProperties×÷ÓÃÊÇ£º¶ÔchannelsÔªËØËùº¬µÄÊôÐÔ¸³Öµ(¼
Ïà¹ØÎĵµ£º
±¾ÎÄ·ÖÊ®ËĸöÀà±ð¶ÔÕýÔò±í´ïʽµÄÒâÒå½øÐÐÁ˽âÊÍ£¬ÕâÊ®Ëĸ÷Àà±ðÊÇ£º×Ö·û/×Ö·ûÀà/Ô¤¶¨Òå×Ö·ûÀà/POSIX×Ö·ûÀà/java.lang.CharacterÀà/Unicode¿éºÍÀà±ðµÄÀà/±ß½çÆ¥ÅäÆ÷/GreedyÊýÁ¿´Ê/ReluctantÊýÁ¿´Ê/PossessiveÊýÁ¿´Ê/LogicalÔËËã·û/BackÒýÓÃ/ÒýÓÃ/ÌØÊâ¹¹Ôì¡£
1.1.×Ö·û
x ×Ö·û x¡£ÀýÈça±íʾ×Ö·ûa
\\&nbs ......
List <String> sqlFileList = new ArrayList <String>();
public List <String> readSqlFiles(List <String> fileNameList) {
List <String> sqlList = new ArrayList <String>();
for (String fi ......
xml »ù´¡ÖªÊ¶
1.½éÉÜ
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒ
Ìض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤ ......
×÷Ϊjava³ÌÐòÔ±£¬ÖÐÎĵÄÂÒÂëÎÊÌâ»á¾³£Åöµ½¡£¹ýÈ¥µÄÒ»¸öÏîÄ¿£¬ÎÒÅöµ½Á˸÷ÖÖÀàÐ͵ÄjavaÂÒÂëÎÊÌâ¡£ÏÈ·ÖÏí¸ø´ó¼Ò£º
1£ºÍøÒ³PostÇëÇó£¬Ìá½»ºó£¬ÏÔʾÌá½»½á¹û£¬ÂÒÂë¡£
Ê×ÏÈÈ·¶¨Êý¾Ý¿âµÄ±àÂ뷽ʽ¡£ÕâÀïÎÒ·¢ÏÖ£¬Èç¹ûÊý¾Ý¿âµÄ±àÂë²»ÊÇUTF-8£¬PostÇëÇóÒ²¿ÉÒÔ±£Ö¤»ØÏÔÕýÈ·£¬µ«ÊÇÓÐÒ»¸öµØ·½Òª×¢Òâ¡£
ÈçhtmlÖУº
£¨1£©<i ......
JavaÃæÊÔÌâ—»ù´¡·½Ãæ:
1¡¢×÷ÓÃÓòpublic,private,protected,ÒÔ¼°²»Ð´Ê±µÄÇø±ð£¿
´ð£ºÇø±ðÈçÏ£º
×÷ÓÃÓò µ±Ç°Àà ͬһpackag ×ÓËïÀà ÆäËûpackage
public √ √ √ √
protected √ √ √ ×
friendly √ √ × ×
pr ......