1 17 18 19 package org.apache.commons.digester; 20 21 22 29 30 public class TestRuleSet extends RuleSetBase { 31 32 33 35 36 39 public TestRuleSet() { 40 41 this(null, null); 42 43 } 44 45 46 52 public TestRuleSet(String prefix) { 53 54 this(prefix, null); 55 56 } 57 58 59 66 public TestRuleSet(String prefix, String namespaceURI) { 67 68 super(); 69 if (prefix == null) 70 this.prefix = ""; 71 else 72 this.prefix = prefix; 73 this.namespaceURI = namespaceURI; 74 75 } 76 77 78 80 81 85 protected String prefix = null; 86 87 88 90 91 100 public void addRuleInstances(Digester digester) { 101 102 digester.addObjectCreate(prefix + "employee", Employee.class); 103 digester.addSetProperties(prefix + "employee"); 104 digester.addObjectCreate("employee/address", 105 "org.apache.commons.digester.Address"); 106 digester.addSetProperties(prefix + "employee/address"); 107 digester.addSetNext(prefix + "employee/address", 108 "addAddress"); 109 110 } 111 112 113 } 114 | Popular Tags |