XML文档Java解析库 Commons Digester 3.2 发布

openkk 10年前
     <p><img alt="XML文档Java解析库 Commons Digester 3.2 发布" src="https://simg.open-open.com/show/697cb780b6e1ca0606bc7a2d04c8d72b.png" width="300" height="100" /></p>    <p>Digester 3.2 发布了,<a href="/misc/goto?guid=4958196740060221405" target="_blank">Digester </a>是一个基于规则的XML文档解析库,主要用于XML到Java对象的映射。Struts就是用Digester来处理XML配置文件的。而且Digester还包含一个写好的RSS解析器。</p>    <p>下面是一段使用 Digester 解析 XML 的代码:</p>    <pre>  Digester digester = new Digester();    digester.setValidating(false);    digester.addObjectCreate("foo", "mypackage.Foo");    digester.addSetProperties("foo");    digester.addObjectCreate("foo/bar", "mypackage.Bar");    digester.addSetProperties("foo/bar");    digester.addSetNext("foo/bar", "addBar", "mypackage.Bar");    Foo foo = (Foo) digester.parse();</pre>    <p>该版本主要改进包括:</p>    <p>新特性<br /> =============<br />  * [DIGESTER-153] Add Constructor support to ObjectCreateRule.<br /> <br /> 修复的bug<br /> ===========================<br />  * [DIGESTER-159] */object-param-rule is not managed in the XML rules.<br />  * [DIGESTER-155] ClassLoader reference set to DigesterLoader not set in produced Digester instances<br />  * [DIGESTER-154] The DigesterBinder is not able to load primitive classes by name<br /> <br /> 改进<br /> ===================================<br />  * [DIGESTER-160] provide an additional artifact with shaded dependencies<br />  * [DIGESTER-157] Improve Set(Nested)PropertiesRuleAlias performances in the XML ruleset while binding rules<br />  * [DIGESTER-156] Make (Nested|Set)PropertiesBuilder#addAlias() fluent.<br />  * [DIGESTER-152] The DigesterLoader doesn't allow binding a default Locator<br />  * [DIGESTER-151] The DigesterLoader doesn't allow binding a default ErrorHandler.</p>