Simple XML


    <p style="">之前曾写过一blog :<span class="Apple-converted-space">?</span><a style="color: #108ac6; text-decoration: underline;" href="http://sjsky.iteye.com/blog/784434">XStream序列化JAVA对象为XML以及反序列化<span class="Apple-converted-space">?</span></a>(http://sjsky.iteye.com/blog/784434),今天介绍另一个Java Bean&lt;-&gt;XML 之间序列化和反序列化的轻量级工具:Simple</p>
<p style="">官网:<a style="color: #108ac6; text-decoration: underline;" href="http://simple.sourceforge.net/home.php">http://simple.sourceforge.net/home.php</a></p>
<p style="">截止目前最新版本(附近可下载):<a style="color: #108ac6; text-decoration: underline;" href="http://dl.iteye.com/topics/download/d4c3dd79-5369-3c64-a69c-03e5d2b2e17d">simple-xml-2.6.1.jar</a></p>
<p style="">?</p>
<p style=""><span style="color: #0000ff;"><strong style="font-weight: bold;">特点:</strong></span></p>
<ul style="">
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;"><span style="color: #ff0000;">jar lib文件只有360K左右的大小</span></li>
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;"><span style="color: #ff0000;">它的使用不需要依赖于其他 JAR 文件</span></li>
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;"><span style="color: #ff0000;">通过注解的方式,灵活方便</span></li>
</ul>
<p style=""><strong style="font-weight: bold;">下面将分节详细介绍Simple的特点和使用方法:</strong></p>
<ul style="">
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;">[一]、简单bean的序列化和反序列化</li>
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;">[二]、自定义节点名称?</li>
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;">[三]、嵌套对象</li>
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;">[四]、可选的非强制性的元素或属性</li>
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;">[五]、List&lt;Object&gt;处理</li>
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;">[六]、inline 参数用法</li>
<li style="margin: 0px 0px 0.25em 30px; padding: 0px;">[七]、构造函数的注解处理</li>
</ul>
<p style="">?</p>
<p style=""><span style="color: #ff0000; font-size: medium;">[一]、简单bean的序列化和反序列化</span></p>
<p style="">?</p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">1.java bean</span></p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?java.util.Date;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Element;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?MyTestVo?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?userName;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?wife;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?realName;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?Date?bornDate;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?Double?height;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?toString()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?</span><span class="string" style="color: blue;">"MyTestVo?:?[?userName?=?"</span><span style="color: black;">?+?userName?+?</span><span class="string" style="color: blue;">"?,?wife?=?"</span><span style="color: black;">?+?wife??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????????+?<span class="string" style="color: blue;">"?,?realName?=?"</span><span style="color: black;">?+?realName?+?</span><span class="string" style="color: blue;">"?,?height?=?"</span><span style="color: black;">?+?height??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????????+?<span class="string" style="color: blue;">"?,?bornDate?=?"</span><span style="color: black;">?+?bornDate?+?</span><span class="string" style="color: blue;">"?]"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="comment" style="color: #008200;">//省略set?get等方法</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????......??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">2.序列化</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">static</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?main(String[]?args)?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">throws</span><span style="color: black;">?Exception?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????String?xmlpath?=?<span class="string" style="color: blue;">"d:/test/michael/simple_testvo.xml"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????MyTestVo?vo?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?MyTestVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????vo.setUserName(<span class="string" style="color: blue;">"michael"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????vo.setRealName(<span class="string" style="color: blue;">"大大"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????vo.setWife(<span class="string" style="color: blue;">"小小"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????vo.setHeight(<span class="number" style="color: #c00000;">173</span><span style="color: black;">.3d);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????vo.setBornDate(<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?Date());??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">try</span><span style="color: black;">?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????Serializer?serializer?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?Persister();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????File?result?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?File(xmlpath);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????serializer.write(vo,?result);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????}?<span class="keyword" style="color: #7f0055; font-weight: bold;">catch</span><span style="color: black;">?(Exception?e)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????e.printStackTrace();??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p style="">??? 序列化成功生成的simple_testvo.xml文件如下:</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Xml代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-xml" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">myTestVo</span><span style="color: black;">?</span><span class="attribute" style="color: red;">wife</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"小小"</span><span style="color: black;">?</span><span class="attribute" style="color: red;">realName</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"大大"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">userName</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">michael</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">userName</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">bornDate</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">2011-09-28?17:39:59.432?CST</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">bornDate</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">height</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">173.3</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">height</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">myTestVo</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
</ol>

<p style="">??<span class="Apple-converted-space">?</span><span style="color: #ff0000;"><span style="color: #000000;">ps:</span><span class="Apple-converted-space">?</span>注解可以把Java的属性序列化时指定为属性或者节点元素</span></p>
<p style="">?</p>
<p style="">???<span class="Apple-converted-space">?</span><span style="color: #0000ff;">3.反序列化</span></p>
<p style="">?</p>
<p style="">??? 把上述生成的XML文件反序列化成Java bean测试代码:</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">static</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?main(String[]?args)?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">throws</span><span style="color: black;">?Exception?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????String?xmlpath?=?<span class="string" style="color: blue;">"d:/test/michael/simple_testvo.xml"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????????</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????Serializer?serializer?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?Persister();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????File?source?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?File(xmlpath);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">try</span><span style="color: black;">?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????MyTestVo?vo?=?serializer.read(MyTestVo.<span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">,?source);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????System.out.println(vo);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????}?<span class="keyword" style="color: #7f0055; font-weight: bold;">catch</span><span style="color: black;">?(Exception?e)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????e.printStackTrace();??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p style="">?<span class="Apple-converted-space">?</span><span style="color: #ff0000;">如果XML中包括中文字符有可能反序列化时会报错,以utf-8的编码读取XML文件即可,故修改代码如下:</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*?@param?args</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*?@throws?Exception</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">static</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?main(String[]?args)?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">throws</span><span style="color: black;">?Exception?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????String?xmlpath?=?<span class="string" style="color: blue;">"d:/test/michael/simple_testvo.xml"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????Serializer?serializer?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?Persister();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????<span class="keyword" style="color: #7f0055; font-weight: bold;">try</span><span style="color: black;">?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????InputStreamReader?is?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?InputStreamReader(</span><span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?FileInputStream(??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????????????xmlpath),?<span class="string" style="color: blue;">"utf-8"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????PropertyList?parseVo?=?serializer.read(PropertyList.<span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">,?is);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????System.out.println(parseVo);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????}?<span class="keyword" style="color: #7f0055; font-weight: bold;">catch</span><span style="color: black;">?(Exception?e)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????e.printStackTrace();??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???}??</span></li>
</ol>

<p style="">? 运行反序列化,打印Java bean信息如下:</p>
<div class="quote_div" style="">MyTestVo : [ userName = michael , wife = 小小小 , realName = 大大 , height = 173.3 , bornDate = Wed Sep 28 17:39:59 CST 2011 ]<br>

<p><span style="">?</span></p>
<p style=""><span style="color: #ff0000; font-size: medium;">[二]、自定义节点名称</span></p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">1.java bean</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?java.util.Date;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Element;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"MyTest"</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?MyTestVo?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?userName;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"MyWife"</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?wife;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?realName;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"born"</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?Date?bornDate;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?Double?height;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Override</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?toString()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?</span><span class="string" style="color: blue;">"MyTestVo?:?[?userName?=?"</span><span style="color: black;">?+?userName?+?</span><span class="string" style="color: blue;">"?,?wife?=?"</span><span style="color: black;">?+?wife??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????????+?<span class="string" style="color: blue;">"?,?realName?=?"</span><span style="color: black;">?+?realName?+?</span><span class="string" style="color: blue;">"?,?height?=?"</span><span style="color: black;">?+?height??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????????+?<span class="string" style="color: blue;">"?,?bornDate?=?"</span><span style="color: black;">?+?bornDate?+?</span><span class="string" style="color: blue;">"?]"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="comment" style="color: #008200;">//set?get?......</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p style=""><span style="color: #0000ff;">????? 2.序列化</span></p>
<p style="">?</p>
<p style="">?? 序列化后生成的simple_testvo.xml文件如下:</p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Xml代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-xml" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">MyTest</span><span style="color: black;">?</span><span class="attribute" style="color: red;">MyWife</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"小小"</span><span style="color: black;">?</span><span class="attribute" style="color: red;">realName</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"大大"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">userName</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">michael</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">userName</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">born</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">2011-09-28?21:47:37.455?CST</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">born</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">height</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">173.3</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">height</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">MyTest</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
</ol>

<p style="">?? 可以和之前的序列化XML文件对比下,看看区别在哪里。</p>
<p style="">?</p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">3.反序列化</span></p>
<p style="">?</p>
<p style="">?????? 运行反序列化程序后的打印结果如下:</p>
<div class="quote_div" style="">MyTestVo : [ userName = michael , wife = 小小 , realName = 大大 , height = 173.3 , bornDate = Wed Sep 28 21:47:37 CST 2011 ]
<p><span style="">?</span></p>
<p style=""><span style="color: #ff0000; font-size: medium;">[三]、嵌套对象</span></p>
<p style="">?</p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">1.java bean</span></p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Element;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?ConfigurationVo?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?ServerVo?server;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">int</span><span style="color: black;">?id;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?ServerVo?getServer()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?server;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">int</span><span style="color: black;">?getId()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?id;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setServer(ServerVo?pServer)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????server?=?pServer;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setId(</span><span class="keyword" style="color: #7f0055; font-weight: bold;">int</span><span style="color: black;">?pId)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????id?=?pId;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Element;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?ServerVo?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">int</span><span style="color: black;">?port;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?host;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?SecurityVo?security;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">int</span><span style="color: black;">?getPort()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?port;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?getHost()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?host;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?SecurityVo?getSecurity()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?security;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setPort(</span><span class="keyword" style="color: #7f0055; font-weight: bold;">int</span><span style="color: black;">?pPort)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????port?=?pPort;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setHost(String?pHost)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????host?=?pHost;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setSecurity(SecurityVo?pSecurity)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????security?=?pSecurity;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p><span style="">?</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Element;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?SecurityVo?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">boolean</span><span style="color: black;">?ssl;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?keyStore;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">boolean</span><span style="color: black;">?isSsl()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?ssl;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?getKeyStore()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?keyStore;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setSsl(</span><span class="keyword" style="color: #7f0055; font-weight: bold;">boolean</span><span style="color: black;">?pSsl)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????ssl?=?pSsl;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setKeyStore(String?pKeyStore)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????keyStore?=?pKeyStore;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p><span style="">?</span></p>
<p style=""><span style="color: #0000ff;">????? 2.序列化</span></p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?????*?@param?args</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?????*?@throws?Exception</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?????*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">static</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?main(String[]?args)?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">throws</span><span style="color: black;">?Exception?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????String?xmlpath?=?<span class="string" style="color: blue;">"d:/test/michael/simple_testvo.xml"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????SecurityVo?security?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?SecurityVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????security.setSsl(<span class="keyword" style="color: #7f0055; font-weight: bold;">true</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????security.setKeyStore(<span class="string" style="color: blue;">"Michael"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????ServerVo?server?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?ServerVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????server.setHost(<span class="string" style="color: blue;">"sjsky.iteye.com"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????server.setPort(<span class="number" style="color: #c00000;">8088</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????server.setSecurity(security);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????ConfigurationVo?config?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?ConfigurationVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????config.setId(<span class="number" style="color: #c00000;">10000</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????config.setServer(server);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????Serializer?serializer?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?Persister();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">try</span><span style="color: black;">?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????File?xmlFile?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?File(xmlpath);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????serializer.write(config,?xmlFile);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????}?<span class="keyword" style="color: #7f0055; font-weight: bold;">catch</span><span style="color: black;">?(Exception?e)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????e.printStackTrace();??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p style="">?? 运行上述方法,序列化生成的XML文件如下:</p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Xml代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-xml" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">configurationVo</span><span style="color: black;">?</span><span class="attribute" style="color: red;">id</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"10000"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">server</span><span style="color: black;">?</span><span class="attribute" style="color: red;">port</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"8088"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">host</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">sjsky.iteye.com</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">host</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">security</span><span style="color: black;">?</span><span class="attribute" style="color: red;">ssl</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"true"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">keyStore</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">Michael</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">keyStore</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">security</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">server</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">configurationVo</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
</ol>

<p><span style="">?</span></p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">3.反序列化的方法和之前的一致,自己</span><span class="Apple-converted-space">?</span><span style="color: #0000ff;">可以</span><span class="Apple-converted-space">?</span><span style="color: #0000ff;">测试下结果是否正确。</span></p>
<p style="">?</p>
<p style=""><span style="color: #ff0000; font-size: medium;">[四]、可选的非强制性的元素或属性</span></p>
<p style="">?</p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">1.java bean</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?java.util.Date;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Element;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?MyTestVo?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?userName;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="comment" style="color: #008200;">//?不是每个人都有妻子的?吼吼</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">(required?=?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">false</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?wife;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?realName;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="comment" style="color: #008200;">//?不想泄露年龄噢</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">(required?=?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">false</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?Date?bornDate;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?Double?height;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Override</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?toString()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?</span><span class="string" style="color: blue;">"MyTestVo?:?[?userName?=?"</span><span style="color: black;">?+?userName?+?</span><span class="string" style="color: blue;">"?,?wife?=?"</span><span style="color: black;">?+?wife??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????????+?<span class="string" style="color: blue;">"?,?realName?=?"</span><span style="color: black;">?+?realName?+?</span><span class="string" style="color: blue;">"?,?height?=?"</span><span style="color: black;">?+?height??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????????+?<span class="string" style="color: blue;">"?,?bornDate?=?"</span><span style="color: black;">?+?bornDate?+?</span><span class="string" style="color: blue;">"?]"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="comment" style="color: #008200;">//省略setter?getter方法</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p style="">?</p>
<p style=""><span style="color: #0000ff;">????? 2.序列化</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*?@param?args</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*?@throws?Exception</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">static</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?main(String[]?args)?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">throws</span><span style="color: black;">?Exception?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????String?xmlpath?=?<span class="string" style="color: blue;">"d:/test/michael/simple_testvo.xml"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????MyTestVo?vo?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?MyTestVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????vo.setUserName(<span class="string" style="color: blue;">"michael"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????vo.setRealName(<span class="string" style="color: blue;">"大大"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????vo.setHeight(<span class="number" style="color: #c00000;">173</span><span style="color: black;">.3d);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????Serializer?serializer?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?Persister();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????<span class="keyword" style="color: #7f0055; font-weight: bold;">try</span><span style="color: black;">?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????File?xmlFile?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?File(xmlpath);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????serializer.write(vo,?xmlFile);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????}?<span class="keyword" style="color: #7f0055; font-weight: bold;">catch</span><span style="color: black;">?(Exception?e)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????e.printStackTrace();??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????}??</span></li>
</ol>

<p style="">?? 运行序列化程序后生成的XML文件如下:</p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Xml代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-xml" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">myTestVo</span><span style="color: black;">?</span><span class="attribute" style="color: red;">realName</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"大大"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">userName</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">michael</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">userName</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">height</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">173.3</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">height</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">myTestVo</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
</ol>

<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">3.反序列化</span></p>
<p style="">?</p>
<p style="">???? 运行反序列化程序后打印结果如下:</p>
<p style="">?</p>
<div class="quote_div" style="">MyTestVo : [ userName = michael , wife = null , realName = 大大 , height = 173.3 , bornDate = null ]
<p style="">?</p>
<p style=""><span style="color: #ff0000; font-size: medium;">[五]、List&lt;Object&gt;处理</span></p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">1.java bean</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?java.io.FileInputStream;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?java.io.InputStreamReader;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?java.util.ArrayList;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?java.util.List;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.ElementList;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Serializer;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.core.Persister;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?PropertyList?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@ElementList</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?List&lt;EntryVo&gt;?list;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?List&lt;EntryVo&gt;?getList()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?list;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?getName()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setList(List&lt;EntryVo&gt;?pList)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????list?=?pList;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setName(String?pName)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????name?=?pName;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Override</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?toString()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?</span><span class="string" style="color: blue;">"PropertyList?:?[?name?=?"</span><span style="color: black;">?+?name?+?</span><span class="string" style="color: blue;">"?,?EntryVo?list?size?=?"</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????????+?list.size()?+?<span class="string" style="color: blue;">"?]?."</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p><span style="">?</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Element;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?EntryVo?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?value;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?getName()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?getValue()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?value;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setName(String?pName)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????name?=?pName;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setValue(String?pValue)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????value?=?pValue;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p><span style="">?</span></p>
<p style=""><span style="color: #0000ff;">????? 2.序列化</span></p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*?@param?args</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*?@throws?Exception</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">????*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">static</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?main(String[]?args)?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">throws</span><span style="color: black;">?Exception?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????String?xmlpath?=?<span class="string" style="color: blue;">"d:/test/michael/simple_testvo.xml"</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????Serializer?serializer?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?Persister();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????<span class="keyword" style="color: #7f0055; font-weight: bold;">try</span><span style="color: black;">?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????PropertyList?vo?=?initBean();??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????serializer.write(vo,?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?File(xmlpath));??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????}?<span class="keyword" style="color: #7f0055; font-weight: bold;">catch</span><span style="color: black;">?(Exception?e)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????????e.printStackTrace();??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">static</span><span style="color: black;">?PropertyList?initBean()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????PropertyList?vo?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?PropertyList();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????vo.setName(<span class="string" style="color: blue;">"Wife?List"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????List&lt;EntryVo&gt;?subList?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?ArrayList&lt;EntryVo&gt;();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????EntryVo?subvo?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?EntryVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo.setName(<span class="string" style="color: blue;">"A"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo.setValue(<span class="string" style="color: blue;">"福晋"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subList.add(subvo);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?EntryVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo.setName(<span class="string" style="color: blue;">"B"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo.setValue(<span class="string" style="color: blue;">"侧福晋"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subList.add(subvo);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?EntryVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo.setName(<span class="string" style="color: blue;">"C"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo.setValue(<span class="string" style="color: blue;">"小三"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subList.add(subvo);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo?=?<span class="keyword" style="color: #7f0055; font-weight: bold;">new</span><span style="color: black;">?EntryVo();??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo.setName(<span class="string" style="color: blue;">"D"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subvo.setValue(<span class="string" style="color: blue;">"二奶"</span><span style="color: black;">);??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????subList.add(subvo);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????vo.setList(subList);??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?vo;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???}??</span></li>
</ol>

<p><span style="">?</span></p>
<p style="">?运行序列化程序后生成的XML文件如下:</p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Xml代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-xml" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">propertyList</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"Wife?List"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">list</span><span style="color: black;">?</span><span class="attribute" style="color: red;">class</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"java.util.ArrayList"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">entryVo</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"A"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">福晋</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">entryVo</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">entryVo</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"B"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">侧福晋</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">entryVo</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">entryVo</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"C"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">小三</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">entryVo</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">entryVo</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"D"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">二奶</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">entryVo</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">list</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">propertyList</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
</ol>

<p style="">?</p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">3.反序列化,运行结果打印对象信息如下:</span></p>
<p style="">?</p>
<div class="quote_div" style="">PropertyList : [ name = Wife List , EntryVo list size = 4 ] .
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">4.修改注解@ElementList的参数</span></p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@ElementList</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"WifeList"</span><span style="color: black;">,?entry?=?</span><span class="string" style="color: blue;">"wife"</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?List&lt;EntryVo&gt;?list;??</span></span></li>
</ol>

<p style="">??? 序列化后生成的XML文件如下:</p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Xml代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-xml" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">propertyList</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"Wife?List"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">WifeList</span><span style="color: black;">?</span><span class="attribute" style="color: red;">class</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"java.util.ArrayList"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">wife</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"A"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">福晋</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">wife</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">wife</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"B"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">侧福晋</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">wife</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">wife</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"C"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">小三</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">wife</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">wife</span><span style="color: black;">?</span><span class="attribute" style="color: red;">name</span><span style="color: black;">=</span><span class="attribute-value" style="color: blue;">"D"</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">?????????<span class="tag" style="color: #006699; font-weight: bold;">&lt;</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">二奶</span><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">value</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">wife</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???<span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">WifeList</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="tag" style="color: #006699; font-weight: bold;">&lt;/</span><span class="tag-name" style="color: #006699; font-weight: bold;">propertyList</span><span class="tag" style="color: #006699; font-weight: bold;">&gt;</span><span style="color: black;">??</span></span></li>
</ol>

<p style="">??? 注意XML文件的变化。</p>
<p style="">?</p>
<p style=""><span style="color: #ff0000; font-size: medium;">[六]、</span><span class="Apple-converted-space">?</span><span style="color: #ff0000;"><span style="font-size: medium;">inline 参数用法</span></span></p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">1.java bean</span></p>
<p style="">?????? 以上节中得bean为基础修改注解如下:</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?PropertyList?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@ElementList</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"WifeList"</span><span style="color: black;">,?entry?=?</span><span class="string" style="color: blue;">"wife"</span><span style="color: black;">,?inline?=?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">true</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?List&lt;EntryVo&gt;?list;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?List&lt;EntryVo&gt;?getList()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?list;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?getName()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setList(List&lt;EntryVo&gt;?pList)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????list?=?pList;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setName(String?pName)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????name?=?pName;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Override</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?toString()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?</span><span class="string" style="color: blue;">"PropertyList?:?[?name?=?"</span><span style="color: black;">?+?name?+?</span><span class="string" style="color: blue;">"?,?EntryVo?list?size?=?"</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????????????+?list.size()?+?<span class="string" style="color: blue;">"?]?."</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p><span style="">?</span></p>
<p style=""><span style="color: #0000ff;">????? 2.序列化后生成的XML文件如下:</span></p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span style="color: black;">&lt;propertyList?name=</span><span class="string" style="color: blue;">"Wife?List"</span><span style="color: black;">&gt;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???&lt;wife?name=<span class="string" style="color: blue;">"A"</span><span style="color: black;">&gt;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????&lt;value&gt;福晋&lt;/value&gt;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???&lt;/wife&gt;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???&lt;wife?name=<span class="string" style="color: blue;">"B"</span><span style="color: black;">&gt;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????&lt;value&gt;侧福晋&lt;/value&gt;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???&lt;/wife&gt;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???&lt;wife?name=<span class="string" style="color: blue;">"C"</span><span style="color: black;">&gt;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????&lt;value&gt;小三&lt;/value&gt;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???&lt;/wife&gt;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???&lt;wife?name=<span class="string" style="color: blue;">"D"</span><span style="color: black;">&gt;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??????&lt;value&gt;二奶&lt;/value&gt;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">???&lt;/wife&gt;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">&lt;/propertyList&gt;??</span></li>
</ol>

<p style="">? ? 和上节生成的文件相比,XML结构少了一个层次。</p>
<p style="">?</p>
<p style=""><span style="color: #ff0000; font-size: medium;">[七]、构造函数的注解处理</span></p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">1.java bean</span></p>
<p style="">?</p>
<div class="dp-highlighter" style="">
<div class="bar">
<div class="tools" style="text-align: left; margin: 0px; color: black; font-weight: bold; padding: 3px;">Java代码<span class="Apple-converted-space">?</span><embed quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15" src="http://sjsky.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></embed>?<a style="color: #108ac6; text-decoration: underline;" title="收藏这段代码"><img class="star" style="border-width: 0px;" src="http://sjsky.iteye.com/images/icon_star.png" alt="收藏代码"></a>


<ol class="dp-j" style="padding-bottom: 2px; line-height: 1.4em; background-color: #ffffff; margin: 0px 0px 1px; padding-left: 0px; padding-right: 0px; color: #2b91af; font-size: 1em; padding-top: 2px; border: #d1d7dc 1px solid;">
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">package</span><span style="color: black;">?michael.serialization.simplexml;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Attribute;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Element;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Root;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.Serializer;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">import</span><span style="color: black;">?org.simpleframework.xml.core.Persister;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">/**</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@blog?http://sjsky.iteye.com</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*?@author?Michael</span>?</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="comment" style="color: #008200;">?*/</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="annotation" style="color: #646464;">@Root</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;"><span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">class</span><span style="color: black;">?EntryVo?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?EntryVo(</span><span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"name"</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????String?name,?<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"value"</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????String?value)?{??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">this</span><span style="color: black;">.name?=?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">this</span><span style="color: black;">.value?=?value;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Attribute</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"name"</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Element</span><span style="color: black;">(name?=?</span><span class="string" style="color: blue;">"value"</span><span style="color: black;">)??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">private</span><span style="color: black;">?String?value;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?getName()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?name;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?getValue()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?value;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setName(String?pName)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????name?=?pName;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?</span><span class="keyword" style="color: #7f0055; font-weight: bold;">void</span><span style="color: black;">?setValue(String?pValue)?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????value?=?pValue;??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="annotation" style="color: #646464;">@Override</span><span style="color: black;">??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????<span class="keyword" style="color: #7f0055; font-weight: bold;">public</span><span style="color: black;">?String?toString()?{??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????????<span class="keyword" style="color: #7f0055; font-weight: bold;">return</span><span style="color: black;">?</span><span class="string" style="color: blue;">"EntryVo?:?[?name?=?"</span><span style="color: black;">?+?name?+?</span><span class="string" style="color: blue;">",?value?=?"</span><span style="color: black;">?+?value?+?</span><span class="string" style="color: blue;">"?]."</span><span style="color: black;">;??</span></span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">????}??</span></li>
<li style="border-left: #d1d7dc 1px solid; padding-bottom: 0px; line-height: 18px; background-color: #fafafa; margin: 0px 0px 0px 38px; padding-left: 10px; padding-right: 0px; font-size: 1em; padding-top: 0px;"><span style="color: black;">}??</span></li>
</ol>

<p style="">?</p>
<p style=""><span style="color: #0000ff;">????? 2.序列化</span></p>
<p style="">?</p>
<p style="">????? 生成的XML文件如下:</p>
<div class="quote_div" style="">&lt;entryVo name="blog"&gt;<br>&lt;value&gt;http://sjsky.iteye.com&lt;/value&gt;<br>&lt;/entryVo&gt;
<p><span style="">?</span></p>
<p style="">?????<span class="Apple-converted-space">?</span><span style="color: #0000ff;">3.反序列化</span></p>
<p style="">?</p>
<p style="">????? 反序列化生成的bean的信息打印如下:</p>
<p style="">?</p>
<div class="quote_div" style="">EntryVo : [ name = blog, value = http://sjsky.iteye.com ].
<p style="">?</p>
<p style="">ps:<span style="color: #ff0000;">如果java bean有参数的构函数,需要在构造函数的参数前也加上相应的注解,否则在反序列化时会出错。</span></p>
<p style="">?</p>
<p style="">本文就先介绍到这,下次再介绍其他运用事例。</p>
<p style="">?</p>
<p style="">?</p>
<p style="">本文连接:http://sjsky.iteye.com/blog/1182057</p>
<p style="">?</p>
<p style="">?</p>
<p style="">转载请注明来自:Michael's blog @<span class="Apple-converted-space">?</span><a style="color: #108ac6; text-decoration: underline;" href="http://sjsky.iteye.com/" target="_blank">http://sjsky.iteye.com</a><span class="Apple-converted-space">?</span><a style="color: #108ac6; text-decoration: underline;" href="http://sjsky.iteye.com/" target="_blank"></a><br><br>----------------------------- 分 ------------------------------ 隔 ------------------------------ 线 ------------------------------</p>
 

你可能感兴趣的:(java,工作,Simple XML)