Digester 封装规则集合 (Rule Sets),digestersets,使用方法Digester
分享于 点击 30093 次 点评:14
Digester 封装规则集合 (Rule Sets),digestersets,使用方法Digester
使用方法
Digester digester = new Digester();
//... configure Digester properties ...
digester.addRuleSet(new MyRuleSet("baz/"));
public class MyRuleSet extends RuleSetBase { public MyRuleSet() { this(""); } public MyRuleSet(String prefix) { super(); this.prefix = prefix; this.namespaceURI = "<a href="http://www.mycompany.com/MyNamespace">http://www.mycompany.com/MyNamespace"; } protected String prefix = null; public void addRuleInstances(Digester digester) { digester.addObjectCreate(prefix + "foo/bar", "com.mycompany.MyFoo"); digester.addSetProperties(prefix + "foo/bar"); }}//该片段来自于http://byrx.net
用户点评